How do I find an efficient way to create a matrix from an array
Show older comments
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 :)
Answers (1)
Bruno Luong
on 18 Oct 2018
A = 1:100;
B = (0:100)' + A
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!