h02h001
h02h001

Reputation: 167

Find root of implicit function in MATLAB

I have an implicit function, for example:

f(x,y) = x.^3 + x.*y + y.^2 - 36

I want to solve the root. So f(x,y) = 0.

Drawing the solution is easy:

ezplot('x.^3 + x.*y + y.^2 - 36',[-10 10 -10 10]);

However, I would like to have the data that is in the plot and not only the visual plot. So how do I find the data of the plot? i.e., how to get data OUT of a plot once it is made?

Upvotes: 2

Views: 2839

Answers (1)

Dang Khoa
Dang Khoa

Reputation: 5823

If you supply an output argument to ezplot, it will give you a line handle. One of the properties of line handles is XData and YData. To extract data from the line handles, use get:

LH = ezplot('x.^3 + x.*y + y.^2 - 36',[-10 10 -10 10]);
XData = get(LH, 'XData');
YData = get(LH, 'YData');

Upvotes: 1

Related Questions