Create a 4x4 matrix with values between 1 and 10

59 visualizaciones (últimos 30 días)
Glinting Orc
Glinting Orc el 8 de Oct. de 2021
Respondida: Image Analyst el 8 de Oct. de 2021
Hello! I have this problem that I've been trying to figure out. I've used the following to solve it:
A = randi([1 10],4,4):
A =
9 7 10 10
10 1 10 5
2 3 2 9
10 6 10 2
I would like to know if there's a way to solve it but having decimals included in the answer. As far as I know by using randi you will only get integers, can rand() help in this case?
Thank you so much in advance!

Respuestas (1)

Image Analyst
Image Analyst el 8 de Oct. de 2021
A = 1 + 9 * rand(4,4)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by