Deleting certain data from a graph

9 visualizzazioni (ultimi 30 giorni)
Jason
Jason il 13 Mag 2016
Risposto: Jason il 13 Mag 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

Risposta accettata

Jason
Jason il 13 Mag 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?

Più risposte (0)

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by