Why is my plot not showing any line?

1 回表示 (過去 30 日間)
Mamad Mamadi
Mamad Mamadi 2019 年 1 月 6 日
編集済み: madhan ravi 2019 年 1 月 6 日
im writing these codes but when i run it i cnt see any line, could u plz help me
for i = 1:5
Iph = (Iscr+ki*(T-Tr))*((S(i))/100);
Irs = Irr*((T/Tr)^3)*(exp(q*Eg/(K*A)))*((1/Tr)-(1/T));
I0 = Np*Iph-Np*Irs*(exp(q/(K*T*A))*(V0./Ns)-1);
P0 = V0.*I0;
figure(1)
plot(V0,I0);
axis([0 50 0 20]);
xlabel('Voltage in volts');
ylabel('Current in Amps');
hold on;
figure(2)
plot(V0,P0);
axis([0 50 0 400]);
xlabel('Voltage in volts')
ylabel('Power in watts');
hold on;
figure(3)
plot(I0,P0);
axis([0 20 0 400]);
xlabel('Current in Amps');
ylabel('Power in Watts');
hold on;
end

回答 (1 件)

madhan ravi
madhan ravi 2019 年 1 月 6 日
You don’t need a loop , just remove for i=1:5 and end
  2 件のコメント
Mamad Mamadi
Mamad Mamadi 2019 年 1 月 6 日
i did it but made an error still not working
madhan ravi
madhan ravi 2019 年 1 月 6 日
編集済み: madhan ravi 2019 年 1 月 6 日
upload the missing datas to run your code , also try putting dots before arithmetic operators in the mean time and try again

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by