Plot two sets of unequal data
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have the data sets in the attached. I need to plot them all in the same figure, with the first one being x. As you can see, the third column has much lower number of values. I guess I need to somehow have them all interpolated to the empty space between each two values is filled up? Or is there anyway Matlab can do it by some sort of function?
2 comentarios
John D'Errico
el 4 de Abr. de 2017
How can we "see"? Have you forgotten to attach something? There are no attachments that you have provided.
Respuestas (1)
KSSV
el 4 de Abr. de 2017
Editada: KSSV
el 4 de Abr. de 2017
You can interpolate your data using interp1.
Read about interp1
[num,txt,raw] = xlsread('values.xls') ;
x = num(:,1) ;
y = num(:,2) ;
xi = num(:,3) ;
xi = sort(xi(~isnan(xi))) ;
yi = interp1(x,y,xi) ;
plot(x,y,'r')
hold on
plot(xi,yi,'k')
2 comentarios
KSSV
el 5 de Abr. de 2017
What is column 3 actually? It has any connection with column 1 or column 2?
Ver también
Categorías
Más información sobre Line 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!