How to create a matrix of Matlab Functions out of a symbolic matrix?

2 ビュー (過去 30 日間)
Jose Antonio Aliaga
Jose Antonio Aliaga 2019 年 6 月 11 日
回答済み: madhan ravi 2019 年 6 月 11 日
Hello. I've got a huge 6x6 symbolic matrix M that can't be just pasted/inlined on a function to substitute values because of its size. I've had some bad experiences with the function subs(), being extremely slow. The recommended alternative is to convert the symbolic expression into a Matlab Function through matlabFunction() and then substitute from it. Given that, I tried:
M = % Huge sym 6x6 matrix
for i = 1:6
for j = 1:6
fM{i,j} = matlabFunction(M(i,j));
end
end
Which throws:
Unable to perform assignment because brace indexing is not supported for variables of this type.
I tried many variants but none of them worked. I feel like I'm very far from the solution, if there's any.
Thank you,
Jose
  3 件のコメント
Walter Roberson
Walter Roberson 2019 年 6 月 11 日
I agree, most likely fM already existed as a non-cell.
Jose Antonio Aliaga
Jose Antonio Aliaga 2019 年 6 月 11 日
That's it Madhan, it works beautifully. Thank you.

サインインしてコメントする。

採用された回答

madhan ravi
madhan ravi 2019 年 6 月 11 日

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by