Why doesn't anything show up on my plot?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
Star Strider
2018년 4월 23일
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');
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!