line doesnt appear on my graph
Show older comments
t=0;
for i=10:-1:4 ;
z=i-1;
A0=pi*(i/2)^2;
Ai=pi*(z/2)^2;
phi=log(A0/Ai);
t=t+phi;
if i>=4
mu=0.05;
elseif i<4
mu=0.02;
end
F=A0*t*mu*80;
hold on
plot(i,F,'--ro')
title('force-stage number graph')
xlabel('Passes(mm)')
ylabel('Force[N]')
hold off
end
3 Comments
John D'Errico
on 26 Dec 2016

John D'Errico
on 26 Dec 2016
Edited: John D'Errico
on 26 Dec 2016
Please don't post additional questions just to add something to your first question. I've moved your pic to a comment, THIS time.
studentt17
on 26 Dec 2016
Accepted Answer
More Answers (2)
John D'Errico
on 26 Dec 2016
0 votes
Why do you expect a line to appear, since you are plotting those points ONE at a time? s far as MATLAB is concerned, you are plotting a set of distinct curves, each of which has only one point. So no line.
Create the entire vector of values first, THEN plot it in one call.
vec = 10:-1:4;
A0V = pi*((vec-0)/2).^2;
A1V = pi*((vec-1)/2).^2;
phi = log(A0V./A1V);
tV = cumsum(phi);
muV = 0.05 * ones(size(vec));
FV = A0V.*tV.*muV.*80
plot(vec,FV,'--ro')
title('force-stage number graph')
xlabel('Passes(mm)')
ylabel('Force[N]')

Categories
Find more on Graphics Performance in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!