Deleting certain data from a graph

8 visualizaciones (últimos 30 días)
Jason
Jason el 13 de Mayo de 2016
Respondida: Jason el 13 de Mayo de 2016
Hi. I have an image of a line that I want to measure its "sharpness". As a crude way, I thought I can just look at the green portion of the data and fit a straightline, using the gradient as my measure. So if my data takes the form x,y, how can I only keep the data such that the yvalue is inbetween say 30% of the max and 30% of the minimum. This will then allow me to perform a straight line fit and I can use the gradient as a crude form of "sharpness"
Thanks Jason

Respuesta aceptada

Jason
Jason el 13 de Mayo de 2016
I've got this far:
mx=max(ydata(:))
mn=min(ydata(:))
ydata=ydata-mn;
mydata=[xdata',ydata']
%use logical indexing to remove data
TF1 = mydata(:,2)<=1.3*mn
TF2 = mydata(:,2)>=0.7*mx
%Combine
TFall = TF1 | TF2
% remove
mydata(TFall,:) = []
subplot(1,3,3)
plot(mydata(:,1),mydata(:,2),'r.','LineWidth',1)
But I have 2 lines, how can I fit both?

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by