Generate Polynomial Expansion Orders as a matrix
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I have to create a polynomial, lets say, with dimensions =4 (x1,x2,x3,x4) and order =2.
Then the expansion becomes:
f= 1+a1*x1+a2*x2+a3*x3+a4*x4+a5*x1^2+a6*x1*x2+a7*x1*x3+a8*x1*x4+a9*x2^2+a10*x2*x3+......so on.
I want these monomial orders in the format such as :
[0,0,0,0;
1,0,0,0;
0,1,0,0;
0,0,1,0;
0,0,0,1;
2,0,0,0;
1,1,0,0;
1,0,1,0,
1,0,0,1;
0,2,0,0;
0,1,1,0;
...... so on]
I am not able to figure out how to get that.
Therefore, requesting your help.
0 个评论
采纳的回答
Bruno Luong
2022-4-17
编辑:Bruno Luong
2022-4-17
4 个评论
Bruno Luong
2022-4-18
编辑:Bruno Luong
2022-4-19
Do you want like this?
A=sortrows(allVL1(4,2,'<='),'descend');
[~,is]=sort(sum(A,2));
A=A(is,:)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polynomials 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!