Running three different cases in my function and plotting three graphs on one plot (figure)
    7 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Asaf McRock
 el 9 de Nov. de 2020
  
    
    
    
    
    Respondida: Geoff Hayes
      
      
 el 9 de Nov. de 2020
            Hello,
I have three different cases inside my function. I run one of them while commenting out the other two and get one plot for it, after that I do the same thing for the other two. How can I run the three cases at once and plot the three graphs on one plot so it's easier to compare them? 
I currently run my function three times, one time for monotonic case and get it's plot, and second time for anti monotonic and lastly random. 
%Monotonic 
[~, ina] = sort(A, 'descend');
[~, inb] = sort(B, 'descend');
%Anti Monotonic 
% [~, ina] = sort(A, 'ascend');
% [~, inb] = sort(B, 'descend');
%Random 
% ina=randperm(N,N);
% inb=randperm(N,N);
0 comentarios
Respuesta aceptada
  Geoff Hayes
      
      
 el 9 de Nov. de 2020
        x = -2*pi:0.01:2*pi;
plot(x, sin(x));
hold on;        % <--- retain the current (and all future) plots
plot(x, cos(x));
plot(x, tan(x));
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Annotations 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!

