Plot an going down exponential curve by using values only
Show older comments
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)
Answers (1)
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)
Categories
Find more on Discrete Data Plots 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!