Compute all third degree monomials out of a given vector

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 comentarios

darova
darova el 30 de Mayo de 2019
What is your question?
See the edited question.
Matt J
Matt J el 3 de Jun. de 2019
Editada: Matt J el 3 de Jun. de 2019
I don't see how you get . There are nchoosek(n,2) pairings of the u(i) and 4 mononomials per pairing, so I get .
Mohamed Abdalmoaty
Mohamed Abdalmoaty el 3 de Jun. de 2019
Editada: Mohamed Abdalmoaty el 3 de Jun. de 2019
Are you counting and as two different monomials? (or and ) ...These count as 1 for me.
For me too.

Iniciar sesión para comentar.

Respuestas (1)

Matt J
Matt J el 3 de Jun. de 2019
Editada: Matt J el 4 de Jun. de 2019
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))

Categorías

Productos

Versión

R2019a

Etiquetas

Preguntada:

el 30 de Mayo de 2019

Editada:

el 4 de Jun. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by