figure shows up but it is empty

I am getting a blank plot. I am using the following code:
c = 0.66*10^-8;
m = 2.25;
K_IC= 65;
R=-1;
a_0 = 0.1;
delta_K_TH = 5;
for sigma_maximum =0:20
a_f = (1/pi)*(K_IC/(1.1215*sigma_maximum))^2;
sigma_minimum =sigma_maximum*R;
delta_sigma= sigma_maximum-sigma_minimum;
delta_K=1.1215*delta_sigma*sqrt(pi*a_f);
if(delta_K >= delta_K_TH)
syms a;
number_cycles = int((c.*(1.1215.*delta_sigma.*sqrt(pi*a)).^ m).^-1,a_0,a_f);
plot(number_cycles,sigma_maximum)
end
end
I would like to have a plot of sigma_maximum as a function of number_cycles

Answers (1)

Image Analyst
Image Analyst on 29 Apr 2014
You're just plotting a single point over and over again. And since hold is not "on", you're blowing away the previous points you plotted. Just index the variables inside the loop (in other words, make them arrays), and do the plot after the loop .

Categories

Tags

Asked:

on 29 Apr 2014

Answered:

on 29 Apr 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!