ok is there a way to do what I want ? I mean how to do it in matlab if I want to study an input parameter variation on an output parameter ?
generating a randn values to study the effect of an input parameter on output parameter
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello all,
I have an input parameter alpha, and I want to study the variation effect of this parameter on an output parameter Output_par. What I did is the following, I tried to change the alpha using the randn function to generate a gaussian.
I have actually 2 questions :
1-When am using the randn function in the following way
alpha=alfa(iii)+5*randn/100;
am I changing the alpha value 5 percent? if not can someone
explain to me what it means using it this way ?
2-once I get all the 10000 values of my output_par, do I have
to add the 5 percent to the std of the gaussian or not ?
for iii=1:10000
tic
alpha=alfa(iii)+5*randn/100;
S_f=(2*mr-5) * (alpha).^2
Tu_f=S_f.*max_lid_beta_f_int;
B=S_f.*Gamma_f;
% for i=1:bheem;
EC_f=final_beta_fine.*B;
[number_line,number_column]=size(EC_f);
EC_f_integrated=[];
transposee_EC_f=EC_f';
for i=1:number_column
X=altitude;
Y(i,:)=transposee_EC_f(i,:);
Y=Y(i,:);
EC_f_int=trapz(X,Y);
EC_f_integrated=[EC_f_integrated EC_f_int];
end;
Output_par=[Output_par EC_f_integrated];
toc
end
thanking you in advance,
0 Kommentare
Akzeptierte Antwort
LE FOU
am 8 Sep. 2011
6 Kommentare
Fangjun Jiang
am 8 Sep. 2011
In that case, I would think rand() is better because it's value is bounded. You can multiply it with a proper scale to make it the effect of a noise but not overwhelm the true signal. But again, you have to make the decision because you know your application.
Weitere Antworten (2)
Fangjun Jiang
am 8 Sep. 2011
1. No, it's not. randn could vary from large negative to large positive although the possibility of a large number is small.
Y = randn returns a pseudorandom, scalar value drawn from a normal distribution with mean 0 and standard deviation 1.
2. You probably have to answer yourself. What is the purpose of the code?
0 Kommentare
LE FOU
am 8 Sep. 2011
1 Kommentar
Fangjun Jiang
am 8 Sep. 2011
1. No and No. Please check a text book. Also, remember you have alfa(iii) involved.
Siehe auch
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!