How to programming the matrix of mn ?
2 次查看(过去 30 天)
显示 更早的评论
I would like to know how to coding the matrix with the following pattern?
Could I use the "for" or ''while" loop or is there any other way to deal with it?
mn=[1 1; 1 3; 1 5; 1 7; 3 1; 3 3; 3 5; 3 7; 5 1; 5 3; 5 5; 5 7; 7 1; 7 3; 7 5; 7 7...........]
Thank you very much!
0 个评论
采纳的回答
更多回答(1 个)
Jonas
2021-5-18
you could e.g. use the kronecker product like
[kron((1:2:18)',ones(4,1)) kron(ones(numel(1:2:18),1),(1:2:7)')]
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!