How to plot desired datapoints on a curve?
    4 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    ekagra gupta
 el 25 de Jul. de 2022
  
    
    
    
    
    Respondida: William Rose
      
 el 25 de Jul. de 2022
            Hello, I have a vector t -> 40000x1 and y -> 40000x1. I wish to plot this data with respect to desired data yhat -> 58x1. How can I do it? Thank you
0 comentarios
Respuesta aceptada
  William Rose
      
 el 25 de Jul. de 2022
        You must have a vector that (58 x 1), which accompanies yhat (58 x 1). Let us create vectors to use as examples:
t=double(1:40000);
y=sin(t/2000)+0.1*randn(size(t));
that=[1:689:40000]';       %time vector, 58 x 1
yhat=sin(that/2000);       %desired data, 58 x 1
Then you may do
yhat=plot(t,y,'b.',that,yhat,'-rx');  
legend('y','yhat');
Good luck.
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Interpolation 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!


