dimanche 5 février 2017

Create Multi-Dimensional random numbers in MATLAB

I have a 4 dimensional dataset with 200 entries. I am going to generate a random values within this dataset. I declared below variables:

mu = median(Input,2);    % find the median of Input as MU
sigma = [2 1; 1 4];      % SIGMA
Data = mvnrnd(mu,sigma,10)';  % Generate random number with "mvnrnd" function

But, MATLAB gives me an error as follows:

Error using mvnrnd (line 76)
MU must be a row vector, or must have CASES rows.

I think that, "mvnrnd" function cannot generate data more than 2D.

Could you please advice me?




Aucun commentaire:

Enregistrer un commentaire