plotting quadratic equation and curve fittting
12 ビュー (過去 30 日間)
古いコメントを表示
im kinda of struck how to plot quadratic function for different x and y values.the equation is (x^25)+(y^3)-(6*x^24*y) for different values of x =[-10,10] and y=[-10,10] and do a polyfit for the obtained point
0 件のコメント
採用された回答
Star Strider
2016 年 12 月 13 日
The plot is straightforward:
fcn = @(x,y) (x.^25)+(y.^3)-(6*x.^24.*y);
[X,Y] = meshgrid(-10:0.5:10);
figure(1)
meshc(X, Y, fcn(X,Y))
grid on
xlabel('X')
ylabel('Y')
I do not know the reason you would want to fit this with polyfit. You already have the equation for the surface.
8 件のコメント
Star Strider
2023 年 6 月 5 日
@M — Your function is not appropriate for this code, since it has only one variable and this code requires functions with two variables.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!