Deleting certain data from a graph

8 Ansichten (letzte 30 Tage)
Jason
Jason am 13 Mai 2016
Beantwortet: Jason am 13 Mai 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

Akzeptierte Antwort

Jason
Jason am 13 Mai 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?

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by