matrix 1xn MatLab

1 Ansicht (letzte 30 Tage)
Takim Mustakim
Takim Mustakim am 8 Nov. 2022
Bearbeitet: Arif Hoq am 8 Nov. 2022
a = [0 0 0 0 0 0 0 0 0 0];
b = [1 2 3];
how to make: c = [1 2 3 0 0 0 0 0 0 0]; from a and b

Akzeptierte Antwort

Arif Hoq
Arif Hoq am 8 Nov. 2022
Bearbeitet: Arif Hoq am 8 Nov. 2022
a = [0 0 0 0 0 0 0 0 0 0];
b = [1 2 3];
a(1:length(b))=b;
c=a
c = 1×10
1 2 3 0 0 0 0 0 0 0

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by