Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Gorbeña
Posts:
4
Registered:
4/18/13


vector and array element multiplication
Posted:
Apr 18, 2013 9:26 PM


Hi, I would like to create a second order polynomial from a vector or a matrix. Each element of the vector or matrix corresponds to an independedent variable.
Given vector A, where A = [x1 x2 x3], I want the following result:
[x1 x1² x1*x2 x1*x3 x2 x2*x1 x2² x1*x3 x3 x3*x1 x3*x2 x3²]
In case I have matrix B = [a1 a2 a3; b1 b2 b3], the desired result will be:
[a1 a1² a1*a2 a1*a3 a2 a2*a1 a2² a1*a3 a3 a3*a1 a3*a2 a3²; b1 b1² b1*b2 b1*b3 b2 b2*b1 b2² b1*b3 b3 b3*b1 b3*b2 b3²]
Does anybody knows how to do this?
Thanks



