How can i apply for loop?
Afficher commentaires plus anciens
hi i am trying to execute for loop and i am having problem as i have not proficiency in Matlab. In following program when I execute for different values of cfo, i got the value of Fp and simply i can plot the graph by intoducing two new arrays of cfo and Fp. But when i use for loop to plot the graph i get nothing. Kindly tell me what is the problem in this.
h=10;
zo=30;
v=0.4;
vo=1;
for cfo=50e3:25e3:200e3;
ip1 = lognrnd(log(33.3e3),0.605,1,1.2e5);
ip = ip1./1e3;
ymax = 0.5;
y1 = 2;
vmax = zo*ip.*y1*h*(1+((v/vo)*(1/sqrt(2))*1/sqrt(1-(0.5*(v/vo)^2))))
A=find(vmax>1.5*cfo);
n = numel(A)
Fp = 200*(n/120000)*ymax
end
plot (cfo,Fp)
set(gca, 'YScale', 'log')
grid on
hold on
Réponse acceptée
Plus de réponses (1)
Arslan Mahmood
le 30 Mai 2019
0 votes
Catégories
En savoir plus sur Graphics Performance dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
