create a matrix!
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Walter Roberson
2012-6-1
Please do not Tag specific individuals for a question, as it puts pressure on the named person to answer.
采纳的回答
Honglei Chen
2012-6-1
repmat(col,2,1)
or
repmat(col,numel(row),1)
4 个评论
Honglei Chen
2012-6-6
You may want to start a new thread and explain the issue. I'm sure someone here can help.
更多回答(1 个)
Ryan
2012-6-1
row = [1 2];
col = [10 11 13];
b = ones(length(row),length(col));
clear m
for m = 1:length(row)
b(m,:) = col;
end
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!