0

I am trying to access the values used to create a boxplot().

I created a plot:

diagram(returns);

Found handles of the outliers:

o = findobj(diagram,'tag','Outliers');

get the data for the outliers:

ydata = get(o,'YData');

problem is it returns this:

ydata = 

    [1x2 double]
    [   -0.1330]
    [1x3 double]
    [       NaN]
    [   -0.0898]
    [       NaN]

Because Some of the plots have multiple outliers. How do I unpack the values of the 1x2 double?

Cape Code
  • 3,584
  • 3
  • 24
  • 45
user3385769
  • 161
  • 6
  • 16

1 Answers1

0

To concatenate all rows in the cell array into a single row:

ydata = [ydata{:}]

And then if you want to ignore NaNs:

ydata = ydata(~isnan(ydata))
smn
  • 548
  • 2
  • 7