fast initialization of cell array of strings mex
Mostrar comentarios más antiguos
I'm looking to initialize a cell array of strings in mex as quickly as possible from a long array of characters with an additional array of the locations of starts and stop from which to grab the strings. Any tips on ways of doing this quickly in Matlab?
I am planning on doing roughly the following:
- intialize with mxCreateCellArray
- initialize a cell with empty values using mxCreateCharArray - I think that using an empty value will prevent any initialization overhead. It would also be great if I could create a bunch of mxArray headers quickly in matlab without having to call a function for each one.
- populate the cell data (string value) using string data that is 2 bytes per character and using mxSetData,mxSetM,mxSetN - here it seems that a smart memory allocator would allow initializing a large block of memory and then breaking it into smaller chunks, rather than individually requesting memory from the OS for each string
2 comentarios
Jim Hokanson
el 22 de Nov. de 2016
James Tursa
el 22 de Nov. de 2016
See comments about using mxCreateUninitNumericMatrix below.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre MATLAB Compiler SDK en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!