How do you graph two equations on the same graph?
1 view (last 30 days)
Show older comments
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 Comments
Answers (2)
Star Strider
on 31 Oct 2019
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 Comments
Sulaymon Eshkabilov
on 31 Oct 2019
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 Comments
See Also
Categories
Find more on 2-D and 3-D 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!