Borrar filtros
Borrar filtros

Why doesn't anything show up on my plot?

1 visualización (últimos 30 días)
Liam Swift
Liam Swift el 23 de Abr. de 2018
Comentada: Star Strider el 23 de Abr. de 2018
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');

Respuesta aceptada

Star Strider
Star Strider el 23 de Abr. de 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 comentarios
Liam Swift
Liam Swift el 23 de Abr. de 2018
Thank you.
Star Strider
Star Strider el 23 de Abr. de 2018
As always, my pleasure.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by