Large matrix in Embedded Matlab in Simulink
이전 댓글 표시
I am working with a simulation in simulink of a robot that uses a laserscanner to position it self. The kinematics is made in Simulink and for positioning a Embedded Matlab fcn is called each sample. The Embedded Matlab fcn contains the code for the laser scanner. The the laser scanner needs a map that now is loaded from the workspace using the constant block, with sample time put to 'inf'. The constant block is then conected directly to the Embedded Matlab fcn.
The problem is that the map is a large int8 matrix and slows down the system. It seems as the Embedded Matlab fcn loads the file from the constant block each sample. Can't I somehow make the map a global variable or something so that the Embedded Matlab fcn doesn't load it each time. Or get the Embedded Matlab fcn to work against the Matlab workspace, where the map is located.
Best regards Magnus
답변 (4개)
Arnaud Miege
2011년 3월 11일
0 개 추천
Pass your matrix as a parameter to the Embedded MATLAB function rather than an input. It should then pick it up from the MATLAB workspace. More details on how set parameter arguments in Embedded MATLAB function blocks in the documentation.
HTH,
Arnaud
Arnaud Miege
2011년 3월 11일
0 개 추천
OK. The other thing to try is to remove some of the debugging and diagnostics, see Speeding Up Simulation in the documentation for more details. Also worth having a look at Speeding Up Simulation with the Basic Linear Algebra Subprograms (BLAS) Library.
Magnus
2011년 3월 11일
0 개 추천
댓글 수: 1
Arnaud Miege
2011년 3월 11일
I'm not sure, sorry. You may want to ask technical support:
http://www.mathworks.co.uk/support/contact_us/index.html
Arnaud
카테고리
도움말 센터 및 File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!