Filter löschen
Filter löschen

move values from uneven size matrix

1 Ansicht (letzte 30 Tage)
Bathrinath
Bathrinath am 7 Mai 2014
Beantwortet: Andrei Bobrov am 7 Mai 2014
I have created 100x6 matrix with zeros. I need to move the first row of gbestseq to first row of globbestseq and remaining rows in globbestseq has to be zero. Here matrix sizes are not same.Suggest some points
n=6; gbestseq=[1,3,2,5,4,6; 2,3,1,4,6,5; 3,2,1,5,4,6;]; globbestseq=zeros(100,n);

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 7 Mai 2014
globbestseq(1,:) = gbestseq(1,:);

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by