Large matrix in Embedded Matlab in Simulink
Ältere Kommentare anzeigen
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
Antworten (4)
Arnaud Miege
am 11 Mär. 2011
0 Stimmen
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
Magnus
am 11 Mär. 2011
0 Stimmen
Arnaud Miege
am 11 Mär. 2011
0 Stimmen
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
am 11 Mär. 2011
0 Stimmen
1 Kommentar
Arnaud Miege
am 11 Mär. 2011
I'm not sure, sorry. You may want to ask technical support:
http://www.mathworks.co.uk/support/contact_us/index.html
Arnaud
Kategorien
Mehr zu Deployment, Integration, and Supported Hardware finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!