Large matrix in Embedded Matlab in Simulink
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuestas (4)
Arnaud Miege
el 11 de Mzo. de 2011
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
0 comentarios
Arnaud Miege
el 11 de Mzo. de 2011
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.
0 comentarios
Magnus
el 11 de Mzo. de 2011
1 comentario
Arnaud Miege
el 11 de Mzo. de 2011
I'm not sure, sorry. You may want to ask technical support:
http://www.mathworks.co.uk/support/contact_us/index.html
Arnaud
Ver también
Categorías
Más información sobre Model Import en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!