Plotting issue where the curve is missing
2 次查看(过去 30 天)
显示 更早的评论
w=linspace(-5,-0.01)
s=100;
for i=1:s
F = (exp(-1.863*10^-2)+w(i).^(-2)*exp(-1.9*10^-4)-2*w(i).^(-1)*exp(-9.41*10^-3));
O=4*pi*F
end
plot(w,O)
0 个评论
采纳的回答
KSSV
2022-6-15
编辑:KSSV
2022-6-15
w=linspace(-5,-0.01) ;
s=100;
O = zeros(size(w)) ;
for i=1:s
F = (exp(-1.863*10^-2)+w(i).^(-2)*exp(-1.9*10^-4)-2*w(i).^(-1)*exp(-9.41*10^-3));
O(i)=4*pi*F ; %<-- save O into an array
end
plot(w,O)
Also note that, you need not to use loop.
w=linspace(-5,-0.01) ;
F = (exp(-1.863*10^-2)+w.^(-2)*exp(-1.9*10^-4)-2*w.^(-1)*exp(-9.41*10^-3));
O=4*pi*F ;
plot(w,O)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!