如何在matlab中创建x和y的三次多项式?

发布于 2025-01-10 14:42:22 字数 275 浏览 2 评论 0原文

我正在浏览 matlab 文档,其中提到可以创建和评估多项式,如 doc

但是,我想创建 x 和 y 的三次多项式。示例:f(x, y) = x^3 + y^3 + 3x^2y + 3xy^2。

我们如何创建 x 和 y 的三次多项式,如上面的示例?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

静水深流 2025-01-17 14:42:22

您发布的链接用于为一个变量的多项式创建系数向量。对于像你这样的两个变量,你可以只使用函数句柄吗?例如,

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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文