Filter löschen
Filter löschen

my question is that

2 Ansichten (letzte 30 Tage)
vipul utsav
vipul utsav am 27 Dez. 2012
a=randn(400); generates 400*400 matrix in matlab,
my question is that this function generates different mean and variance matrix at every time when i run the code. so i require fix mean and variance matrix at every time when i run the code. (not a nearest,every time exact and fixed value)

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 27 Dez. 2012
Bearbeitet: Azzi Abdelmalek am 27 Dez. 2012
nm=[400,400]
v=0.5; %variance
m=2; % mean
out=m+sqrt(v)*randn(nm)
  5 Kommentare
Azzi Abdelmalek
Azzi Abdelmalek am 27 Dez. 2012
The error is 1%. What is the desired precision ?
vipul utsav
vipul utsav am 27 Dez. 2012
ok, is there any idea for reduce this error or any other logic/function?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Random Number Generation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by