create a matrix!
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Walter Roberson
el 1 de Jun. de 2012
Please do not Tag specific individuals for a question, as it puts pressure on the named person to answer.
Respuesta aceptada
Honglei Chen
el 1 de Jun. de 2012
repmat(col,2,1)
or
repmat(col,numel(row),1)
4 comentarios
Honglei Chen
el 6 de Jun. de 2012
You may want to start a new thread and explain the issue. I'm sure someone here can help.
Más respuestas (1)
Ryan
el 1 de Jun. de 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
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!