Clear Filters
Clear Filters

Unable to plot the two for loops together.

1 view (last 30 days)
clc
c = 1;
for w = 0:0.001:1.5
J(c)= ((4*10^-7) * (exp(( (1.66*10^-19 * w) / (1.5*(1.38*10^-23)*298.15)-1))))-40;
w_copy(c) = w;
c = c+1;
end
d = 1;
for y = 0:0.001:1.5
T(d)= ((4*10^-7) * (exp(( (1.66*10^-19 * y) / (1.5*(1.38*10^-23)*298.15)-1))));
a_copy(d) = y;
d = d+1;
end
plot(w_copy,J);
hold on
plot(a_copy,T);
hold on
grid minor
hold off

Accepted Answer

Walter Roberson
Walter Roberson on 27 Apr 2024
The two functions differ by 40 at every location.
40 is much less than the value of the function, which goes up to 5 x 10^10. A difference of 40 in 5E10 is insignificant for plotting purposes.

More Answers (0)

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!