plotting quadratic equation and curve fittting

25 visualizaciones (últimos 30 días)
Avinash Tallapaneni
Avinash Tallapaneni el 13 de Dic. de 2016
Comentada: Star Strider el 5 de Jun. de 2023
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

Respuesta aceptada

Star Strider
Star Strider el 13 de Dic. de 2016
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 comentarios
M
M el 5 de Jun. de 2023
A quite good. but cammand for equation, F(x) = x^3+ 2x+1
Star Strider
Star Strider el 5 de Jun. de 2023
@M — Your function is not appropriate for this code, since it has only one variable and this code requires functions with two variables.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by