Deleting certain data from a graph

9 vues (au cours des 30 derniers jours)
Jason
Jason le 13 Mai 2016
Réponse apportée : Jason le 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

Réponse acceptée

Jason
Jason le 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?

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by