Why doesn't anything show up on my plot?
1 view (last 30 days)
Show older comments
clear all;
clc;
Fi=1000;
Se= 50;
Su= 450;
C= 2/3;
nf=[];
for D=2:01:6;
A= 0.25*pi*(D)^2;
siga= ((C*3662.5+Fi)-(C*1000+1000))/2*A;
sigm= ((C*3662.5+Fi)+(C*1000+1000))/2*A;
sigi= sigm-siga;
nf= (Se*(Su-sigi))/(siga*(Su+Se));
end
figure(1)
D=2:6
plot(D,nf)
xlabel('D');
ylabel('nf');
0 Comments
Accepted Answer
Star Strider
on 23 Apr 2018
Define ‘D’ before the loop, and subscript ‘nf’ in the loop:
Fi=1000;
Se= 50;
Su= 450;
C= 2/3;
nf=[];
D=2:01:6;
for k = 1:numel(D)
A= 0.25*pi*(D(k))^2;
siga= ((C*3662.5+Fi)-(C*1000+1000))/2*A;
sigm= ((C*3662.5+Fi)+(C*1000+1000))/2*A;
sigi= sigm-siga;
nf(k)= (Se*(Su-sigi))/(siga*(Su+Se));
end
figure(1)
plot(D,nf)
xlabel('D');
ylabel('nf');
2 Comments
More Answers (0)
See Also
Categories
Find more on Axis Labels 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!