mardi 4 décembre 2018

Random 3D matrix with decimal numbers

I want to create a 3D matrix of dimensions 681x711x29 with values between -0.3 and 0.3.

W=randi([-0.3, 0.3],681,711,29);

It gives the error:

First input must be a positive scalar integer value IMAX, or two integer values [IMIN IMAX] with IMIN less than or equal to IMAX.

I think it doesn't work because they're decimal numbers. How do I make a 3D matrix with random decimal numbers between -0.3 and 0.3?




Aucun commentaire:

Enregistrer un commentaire