MATLAB: Extracting y-data from ezplot.

dataextractezplotplotsxdataydata

Dear everyone
I've created a plot using ezplot, and I want to extract the ydata. Now I have used the get(object,'YData'), but all I get are the y-axis values. I'm doing the following:
cd=ezplot('1.5*x.^.56*y.^.44=1', [0 6 0 6]);
And then something like:
y=get(cd,'YData');
But all I get is values from 0 to 6, not the shown y-values in the figure! In essence I need all the (x,y)-pairs in the interval (0 excluded)
Thanks in advance Patrick

Best Answer

Hi,
you need to get the contourMatrix:
bla = ezplot('1.5*x.^.56*y.^.44=1', [0 6 0 6]);
tmp = get(bla,'contourMatrix');
figure
plot(tmp(1,:),tmp(2,:))
set(gca,'ylim',[0 6])
Small note: Don't name a variable, e.g. "cd" like a MATLAB function.