create a matrix!
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello I have
row=[1 2];
col=[10 11 13 ];
I want to have b=[10 11 13; 10 11 13]
How can i do that?
1 Kommentar
Walter Roberson
am 1 Jun. 2012
Please do not Tag specific individuals for a question, as it puts pressure on the named person to answer.
Akzeptierte Antwort
Honglei Chen
am 1 Jun. 2012
repmat(col,2,1)
or
repmat(col,numel(row),1)
4 Kommentare
Honglei Chen
am 6 Jun. 2012
You may want to start a new thread and explain the issue. I'm sure someone here can help.
Weitere Antworten (1)
Ryan
am 1 Jun. 2012
row = [1 2];
col = [10 11 13];
b = ones(length(row),length(col));
clear m
for m = 1:length(row)
b(m,:) = col;
end
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!