create a matrix!
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Walter Roberson
il 1 Giu 2012
Please do not Tag specific individuals for a question, as it puts pressure on the named person to answer.
Risposta accettata
Honglei Chen
il 1 Giu 2012
repmat(col,2,1)
or
repmat(col,numel(row),1)
4 Commenti
Honglei Chen
il 6 Giu 2012
You may want to start a new thread and explain the issue. I'm sure someone here can help.
Più risposte (1)
Ryan
il 1 Giu 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
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!