lundi 15 février 2016

Error in Matlab code using rand function

I have been using the following matlab code to generate random numbers,

rand('state',0);
n=100;
m=300;
A=rand(m,n);
b=A*ones(n,1)/2;
c=-rand(n,1);

However, it keeps giving me the message "Error in ESE605_Homework_4 (line 1) rand('state',0)'"I have tried to evaluate the problem, and it says I should switch to using the "rng" function because newer versions of Matlab discourage use of "rand". However, upon switching to the rng, function I am still having issues. Can anyone offer some help?




Aucun commentaire:

Enregistrer un commentaire