Plotting issue where the curve is missing
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Athira T Das
 el 15 de Jun. de 2022
  
    
    
    
    
    Comentada: Athira T Das
 el 15 de Jun. de 2022
            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 comentarios
Respuesta aceptada
  KSSV
      
      
 el 15 de Jun. de 2022
        
      Editada: KSSV
      
      
 el 15 de Jun. de 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)
Más respuestas (0)
Ver también
Categorías
				Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


