fast initialization of cell array of strings mex
Mostra commenti meno recenti
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 Commenti
Jim Hokanson
il 22 Nov 2016
James Tursa
il 22 Nov 2016
See comments about using mxCreateUninitNumericMatrix below.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Write C Functions Callable from MATLAB (MEX Files) in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!