How can i apply for loop?
Show older comments
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
Accepted Answer
More Answers (1)
Arslan Mahmood
on 30 May 2019
0 votes
Categories
Find more on Graphics Performance 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!