Finding the minimum values from a scatter graph ?

18 views (last 30 days)
First, I plotted all the values I found together as a scatter. I have used the hold on function in this file. Now what I want from Matlab is all the lowest Y values for one X value (Also optimum curve). For e.g. see second image the doted line is what I want from my first set of data, but i cannot use min(Sample) function to get my values as the points are not really the minimums of each individual curves.
Need to find the optimum curve from the below graph.
<<
>>

Answers (1)

Walter Roberson
Walter Roberson on 11 Dec 2013
Let X{K} be the X values for curve #K, and let Y{K} be the corresponding Y values. In the following I will take advantage of the fact that I have used cell arrays.
allX = [X{:}];
allY = [Y{:}];
[uX, aidx, bidx] = unique(allX);
minY = accumarray( bidx(:), allY(bidx), [], @min );
scatter( uX, minY )

Categories

Find more on Discrete Data Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!