How do I find an efficient way to create a matrix from an array
显示 更早的评论
A=(1:100);
B=[A;A+1;A+2;....;A+100];
I'd like to create a matrix B but would prefer a faster and more efficient method than writing it out a hundred times, would appreciate any help and tips in general :)
回答(1 个)
Bruno Luong
2018-10-18
A = 1:100;
B = (0:100)' + A
类别
在 帮助中心 和 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!