Problem with large symbolic matrix in matlabFunctionBlock
2 ビュー (過去 30 日間)
古いコメントを表示
I have a symbolic matrix with large dimension and also long elements (18 by 18 call it H) which is the mass matrix in dynamics of a robot and is comprised of many sine and cosine terms. I have to send it to simulink for further simulation. first I tried conversion to string using char(H) and then fprintf to save it in a .txt file but it is very large and its size is 28Mb which is very large for simulink and it makes Simulink stop working then I tried matlabFunctionBlock which is very slow and practically does not respond! then I tried using simplify in the matlab code which generates the matrix but it is also makes me nearly 'out of memory' despite the fact that my available memory is near 8Gb! It should be mentioned that I have a quad core CPU and use a x64 matlab2012b. so I dont know what to do and any suggestion would be appreciated.
0 件のコメント
回答 (1 件)
Deepak Ramaswamy
2014 年 6 月 4 日
If you still have the issue, could you just try matlabFunction(H, your variables) and see if the anonymous function is computed quickly.
Also if H is symmetric, you could zero out the sub-diagonals, generate the code (matlabFunctionBlock) and then hand-modify it to make it symmetric again. Or you could divide and conquer even on the sup-diagonals...
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!