Is there a way to set the range of values when using the magic function?
Show older comments
Lets say I have
M=magic(5)
The values randomly assigned to each positon in the matrix will range from 1 to 25.
Is there any way to generate a 5x5 matrix like this but to control the range of each element, for example 1 to 6?
Answers (1)
Categories
Find more on Matrix Indexing 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!