Azzera filtri
Azzera filtri

Compute all third degree monomials out of a given vector

3 visualizzazioni (ultimi 30 giorni)
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 Commenti
Mohamed Abdalmoaty
Mohamed Abdalmoaty il 3 Giu 2019
Modificato: Mohamed Abdalmoaty il 3 Giu 2019
Are you counting and as two different monomials? (or and ) ...These count as 1 for me.

Accedi per commentare.

Risposte (1)

Matt J
Matt J il 3 Giu 2019
Modificato: Matt J il 4 Giu 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))

Tag

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by