Hi, I'm currently hard coding this but I was wondering ifsomebody could help me with writing a function for thepolynomial expansion of a vector. For example if I have avector [x1 x2] and I want a 2nd order polynomial expansionthen my expanded vector z= [1 x1 x2 x1^2 x1x2 x2^2] which isall the possible cross terms and powers of x1 and x2. Asanother example, if I wanted a second order expansion of [x1x2 x3] then z=[1 x1 x2 x3 x1x2 x2x3 x1x3 x1^2 x2^2 x3^2].Finally, if I needed a third order expansion of [x1 x2], thenz=[1 x1 x2 x1^2 x1x2 x2^2 x1^2x2 x1x2^2 x1^3 x2^3]