Splitting a matrix into addition of two same size Matrices
1 回表示 (過去 30 日間)
古いコメントを表示
A 12*12 Matrix P is given to us,this matrix has each of it's element as a quadratic expression in symolic variable x3.This Matrix P needs to be made into an addition of 3 different 12*12 matrices A,B,C such that P=A*x3^2+B*x3+C
How can we find these matrices A,B,C in matlab ?
0 件のコメント
回答 (2 件)
Walter Roberson
2020 年 7 月 30 日
parts_cell = arrayfun(@(s) coeffs(s,x3,'all'), P, 'uniform', 0);
parts_matrices = num2cell(vertcat(parts_cell{:}),1);
A = reshape(parts_matrices{1}, size(P));
B = reshape(parts_matrices{2}, size(P));
C = reshape(parts_matrices{3}, size(P));
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!