How do you graph two equations on the same graph?
1 次查看(过去 30 天)
显示 更早的评论
Here is the code that I am using for my two equations I am able to graph them separately but when I graph them together my graph is not correct. I am trying to figure out where the two equations intersect.
plot 1
x = 0:.1:10;
I = (-1/5000)*x+(.0018);
plot(x,I)
plot 2
q=1.6022e-19
C=28.73
T=273+C
k=1.3806e-23
Is=1.0e-12
V= 0:0.01:9
n=1
Vt=(k*T)/q
Id=Is*((exp(V/(n*Vt)))-1)
plot(V,Id)
0 个评论
回答(2 个)
Star Strider
2019-10-31
Using your code:
x = 0:.1:10;
I = (-1/5000)*x+(.0018);
plot(x,I)
hold on % hold on
q=1.6022e-19
C=28.73
T=273+C
k=1.3806e-23
Is=1.0e-12
V= 0:0.01:9
n=1
Vt=(k*T)/q
Id=Is*((exp(V/(n*Vt)))-1)
plot(V,Id)
hold off % hold off
Experiment to get the result you want.
0 个评论
Sulaymon Eshkabilov
2019-10-31
Hi,
x = 0:.1:10;
I = (-1/5000)*x+(.0018);
plot(x,I), hold on
%plot 2
q=1.6022e-19;
C=28.73 ;
T=273+C;
k=1.3806e-23 ;
Is=1.0e-12 ;
V= 0:0.01:9;
n=1 ;
Vt=(k*T)/q ;
Id=Is*((exp(V/(n*Vt)))-1) ;
plot(V,Id), legend('x vs. I', 'V vs. Id')
% as two subplots
figure
subplot(211)
plot(x, I)
subplot(212)
plot(V, Id)
Check the values of coefficients/parameters. They seem to be incorrectly typed in.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!