Filter löschen
Filter löschen

Compute all third degree monomials out of a given vector

3 Ansichten (letzte 30 Tage)
Mohamed Abdalmoaty
Mohamed Abdalmoaty am 30 Mai 2019
Bearbeitet: Matt J am 4 Jun. 2019
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 Kommentare
Mohamed Abdalmoaty
Mohamed Abdalmoaty am 3 Jun. 2019
Bearbeitet: Mohamed Abdalmoaty am 3 Jun. 2019
Are you counting and as two different monomials? (or and ) ...These count as 1 for me.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Matt J
Matt J am 3 Jun. 2019
Bearbeitet: Matt J am 4 Jun. 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))

Tags

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by