Plotting issue where the curve is missing
2 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
KSSV
on 15 Jun 2022
Edited: KSSV
on 15 Jun 2022
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)
More Answers (0)
See Also
Categories
Find more on Surface and Mesh 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!