the histgram of G is showing a straght line in this code
1 view (last 30 days)
Show older comments
R10=2e3
dR=0.01
DeltaR=(rand(1000,1)-0.5)*2
R1=R10*(1+DeltaR*dR)
figure; hist(R1,20)
R20=18e3
dR=0.01
R2=R20*(1+DeltaR*dR)
figure; hist(R2,20)
G=1+R2./R1
figure; hist(G,200)
1 Comment
Walter Roberson
on 19 Apr 2021
format long g
R10=2e3
dR=0.01
DeltaR=(rand(1000,1)-0.5)*2;
DeltaR(1:10)
R1=R10*(1+DeltaR*dR);
R1(1:10)
figure; hist(R1,20)
R20=18e3
dR=0.01
R2=R20*(1+DeltaR*dR);
R2(1:10)
figure; hist(R2,20)
G=1+R2./R1
figure; hist(G,200)
Answers (1)
Walter Roberson
on 19 Apr 2021
DeltaR=(rand(1000,1)-0.5)*2
R1=R10*(1+DeltaR*dR)
So R1 is a constant times (1+DeltaR*dR)
R2=R20*(1+DeltaR*dR);
so R2 is a constant times (1+DeltaR*dR)
G=1+R2./R1
The (1+DeltaR*dR) are present in both R2 and R1, so the R2./R1 is going to be R20/R10 which is a constant. So G is going to be 1 + the ratio of the two constants, and so is going to be a constant.
2 Comments
Walter Roberson
on 20 Apr 2021
If you have two difference random DeltaR for R1 and R2, then Yes, the result will not be the same for all of the entries.
See Also
Categories
Find more on Lighting, Transparency, and Shading in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!