Plot an going down exponential curve by using values only

Why I can't plot a graph using the coding below. I wanna plot a Vout againt i, for getting the trendline.
clear
clc
Vin=10;
Vs=5;
Vd=0.7;
R1=2200;
R2=3300;
R3=linspace(0,1e5);
x=R2/R1;
for m=1:100
i=R3(1,m)/R1;
Vout=(x*Vin+x*i*Vs+i*(1+x)*Vd)/(x+i+x*i)
end
figure;
plot(i,Vout)

回答 (1 件)

VBBV
VBBV 2022 年 12 月 9 日

0 投票

clear
clc
Vin=10;
Vs=5;
Vd=0.7;
R1=2200;
R2=3300;
R3=linspace(0,1e5);
x=R2/R1;
for m=1:100
I(m)=R3(1,m)/R1;
Vout(m)=(x*Vin+x*I(m)*Vs+I(m)*(1+x)*Vd)/(x+I(m)+x*I(m));
end
figure;
plot(I,Vout)

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

製品

リリース

R2022b

質問済み:

2022 年 12 月 9 日

回答済み:

2022 年 12 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by