![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174492/image.jpeg)
If I have a equation, suppose x.^2+y.^3-10 ; if I put the values of x and y randomly, Can I find the zeroes of this equation at certain values of x and y ? for example x=3 and y=1, there is zero.
1 回表示 (過去 30 日間)
古いコメントを表示
Mahak SINGH CHAUHAN
2014 年 3 月 11 日
編集済み: Mahak SINGH CHAUHAN
2019 年 9 月 27 日
If I have a equation, suppose x.^2+y.^3-10 ; if I put the values of x and y randomly, Can I find the zeroes of this equation at certain values of x and y ? for example x=3 and y=1, there is zero. Please help me..
0 件のコメント
採用された回答
その他の回答 (1 件)
Matt J
2014 年 3 月 11 日
編集済み: Matt J
2014 年 3 月 11 日
Given a fixed value of x, you can find one corresponding y at which the expression is zero as follows
x=3;
f=@(y) x.^2+y.^3-10;
y_zero = fzero(f, y_guess);
Although, when f() is a polynomial, as in your example, it would be more efficient to use ROOTS instead of FZERO. Also, ROOTS will find you all solutions y for that x, instead of just one.
Similarly for given y, you can find one associated x as follows
y=1;
f=@(x) x.^2+y.^3-10;
x_zero = fzero(f, x_guess);
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!