what is the problem in this code because when i use hold on command in my code but It does not work ,what is my problem ?
2 次查看(过去 30 天)
显示 更早的评论
clc
clear
x = 36 ;
y = 10^16 ;
n = -25:-15 ;
f_1 = ( y .^ n ) ./ ( ( exp( x .*n)) ) ;
f_2 = ( y / exp ( x ) ).^n;
plot(n,f_1,"r")
hold on
plot(n,f_2,"b")
legend('f_1','f_2')
xlabel("n")
hold off
0 个评论
采纳的回答
Jon
2021-10-22
hold on is working but except for some NaN's which aren't plotted your functions f_1 and f_2 produce the same values as a function of n so the two curves are on top of each other
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 NaNs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!