How to Create a 5x5 matrix whose rows are (1:5)?
Show older comments
Create a 5x5 matrix whose rows are (1:5).
Accepted Answer
More Answers (1)
A = repmat(1:5,5,1);
or in general,
N = 5;
A = repmat(1:N,N,1)
Categories
Find more on Particle & Nuclear Physics 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!