Find root of implicit function in MATLAB

不打扰是莪最后的温柔 提交于 2019-12-07 23:33:15

问题


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?


回答1:


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');


来源:https://stackoverflow.com/questions/7356551/find-root-of-implicit-function-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!