フィルターのクリア

random data generation using mean and identity matrix

1 回表示 (過去 30 日間)
fafz1203
fafz1203 2016 年 10 月 17 日
コメント済み: fafz1203 2016 年 10 月 17 日
i want to create a random variable X~N(mu,A), mu is mean = 0 and A is a 10*10 identity matrix. what I want to do is to generate a data with normal distribution with 10*1000 size using the above information. the dimension 10*1000 is very important. please check out my code below: (i keep getting x with 1000*10 even though i want a size of 10*1000)
sigma = eye(10); mu = repelem(zeros,10); xTrain = mvnrnd(mu,sigma,1000);
please help if you can, i know this is very elementary. thanks
  2 件のコメント
KSSV
KSSV 2016 年 10 月 17 日
Cant you transpose the result?
fafz1203
fafz1203 2016 年 10 月 17 日
yeah, i but i was not supposed to do that

サインインしてコメントする。

採用された回答

Massimo Zanetti
Massimo Zanetti 2016 年 10 月 17 日
Just transpose the solution:
MU=zeros(1,10);
SIGMA=eye(10);
xTrain = mvnrnd(MU,SIGMA,1000)';
  1 件のコメント
fafz1203
fafz1203 2016 年 10 月 17 日
i can but i was not supposed to do that

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by