Compute all third degree monomials out of a given vector

3 次查看(过去 30 天)
Suppose you are given a vector
How can one effieciently construct a vector containing all third degree monomials of the vector entries? That is a vector of dimension containing the entries .
  5 个评论
Mohamed Abdalmoaty
编辑:Mohamed Abdalmoaty 2019-6-3
Are you counting and as two different monomials? (or and ) ...These count as 1 for me.

请先登录,再进行评论。

回答(1 个)

Matt J
Matt J 2019-6-3
编辑:Matt J 2019-6-4
p=eps(u);
p(u<0)=-p(u<0);
logresult = nchoosek(log(u+p),2)*[3 2 1 0 ; 0 1 2 3];
result= real(exp(logresult))

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by