Plotting issue where the curve is missing
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
KSSV
il 15 Giu 2022
Modificato: KSSV
il 15 Giu 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)
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Surface and Mesh Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!