Given length of matrix initialize a matrix consisting of natural numbers from 1 to n:
n = 10; x = [ 1 2 3 4 5 6 7 8 9 10];
n = 5; x = [1 2 3 4 5];
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers143
Suggested Problems
-
Find the longest sequence of 1's in a binary sequence.
6822 Solvers
-
4867 Solvers
-
Matrix indexing with two vectors of indices
781 Solvers
-
Find out missing number from a vector of 9 elements
322 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
1282 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!