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!