Surface Plot or Mesh Plot
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
I am quite naive to MATLAB, so i beg your apology for asking simple questions. Here is the code:
A=50;
tau=1;
P_f=0.02;
for i=1:100
v0(i)=i;
v(i)=v0(i).*5/18;
Kf=tan(atan((v(i).*tau)/sqrt((4*A^2)-((v(i)^2)*(tau^2))))-((pi*P_f)/2));
M=(2*A*Kf)/(v(i).*sqrt(1+Kf^2));
Phf(i)=(2/pi)*(atan((v(i).*tau)/sqrt((4*A^2)-(((v(i))^2)*tau^2)))-atan((v(i).*M)/sqrt((4*A^2)-(((v(i))^2)*M^2))));
end
plot (v0,Phf)
Now, how to make a Surface Plot or Mesh Plot of this ?
6 comentarios
Azzi Abdelmalek
el 13 de Jul. de 2014
Editada: Azzi Abdelmalek
el 13 de Jul. de 2014
You need three variables. What are they?
Adnan
el 13 de Jul. de 2014
Star Strider
el 13 de Jul. de 2014
Which other one do you want to plot: Kf, M, or something else?
Adnan
el 13 de Jul. de 2014
Star Strider
el 13 de Jul. de 2014
When I calculated your data, the range (max(Phf)-min(Phf)) = 69.3889e-018. The variations in Phf are on the order of machine precision.
Do this calculation (dPhf/dv0) and plot to illustrate that:
dPhfdv0 = diff([Phf])./diff([v0]);
plot(dPhfdv0)
Adnan
el 14 de Jul. de 2014
Respuestas (1)
Star Strider
el 14 de Jul. de 2014
Probabilities are by definition always positive.
I used dPhfdV0 to illustrate the fact that your Phf array has very little variation. If you want to calculate the statistics, I would calculate those on Phf itself. Calculating the mean and standard deviation are easy enough:
Phfmn = mean(Phf)
Phfsd = std(Phf)
If you want the values that will define the range that Phf will be found within with 95% probability, you can calculate them as:
PhfRng95 = [Phfmn-1.96*Phfsd Phfmn+1.96*Phfsd]
You have to use format long e to see the details of PhfRng95. The value of 1.96 is the inverse normal distribution for the probabilities of 0.025 and 0.975, encompassing a total probability of 0.95.
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!