Problem with large symbolic matrix in matlabFunctionBlock
1 次查看(过去 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!