Home > Net >  How to create a third degree polynomial in x and y in matlab?
How to create a third degree polynomial in x and y in matlab?

Time:03-05

I was going through matlab docs and it's mentioned that a polynomial can be created and evaluated as mentioned in this doc

However, I would like to create a third degree polynomial in x and y. Example: f(x, y) = x^3 y^3 3x^2y 3xy^2.

How do we create a third degree polynomial in x and y, like the example above?

CodePudding user response:

The link you post is for creating a vector of coefficients for a polynomial of one variable. For two variables like you have, could you just use a function handle? E.g.,

f = @(x, y) x.^3   y.^3   3*x.^2.*y   3*x.*y.^2
  • Related