MatLab is plotting only points?
Mostrar comentarios más antiguos
I imported an excel file into matlab and tried to plot it. But the problem is I simply get the individual points they aren't connected. How would I go about and connect those points? Thank you for helping.
Code:
[Data]=xlsread('File.xlsx');
P=Data(:,2);
n=Data(:,3);
eta=Data(:,4);
StartIndex=[1;1+find(abs(diff(Data(:,1))))];
EndIndex=[StartIndex(2:end)-1;size(Data,1)];
for i=1:length(StartIndex)
n1=n(StartIndex(i):EndIndex(i));
P1=P(StartIndex(i):EndIndex(i));
plot(n1,P1,'-o')
hold on
end
1 comentario
Jan
el 30 de Sept. de 2017
I have edited your question and used the "{} Code" button to improve the readability of your code.
Note that the abs() can be omitted in find(abs(diff())).
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!