Pregunta

I am trying to export a .mat file which has data stored with datatype struc to a hd5 format so as to make it compatible with c++ porting using coder. But hd5 only accepts numeric values. The code is giving following error -

Error using ==> h5write at 54 Argument 'Data' failed validation isnumeric.

I am unsure whether I am using it correctly though here's my code

h5write('myfile.h5','/model/filters',model.filters,1,146); 

and also tried but got same error -

h5write('myfile.h5','/model/filters','face_p146_small.mat',1,146);

My doubt is in continuation with my previous question here. Any help regarding porting code from Matlab to C++ having data in .mat file format is much appreciated.

¿Fue útil?

Solución

Finally i found the answer for my scenario. Since the algorithm I am using uses a very complex data, I need to use the binary data format but all the binary data formats supported by Matlab are not supported for conversion/porting to C++.

List of all the functions supported in conversion of Matlab code to C++

http://www.mathworks.in/help/simulink/ug/functions-supported-for-code-generation--alphabetical-list.html

List of Data formats supported by Matlab

http://www.mathworks.in/help/matlab/import_export/supported-file-formats.html

It seems none of the functions data formats supported by matlab are supported in conversion.

Hence I will definitely have to rewrite the code

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top