I want to generate mex function using Matlab coder: MEX function. In my code I used dir function to get the information of the images with png format like below:
%#codegen
coder.inline('never')
coder.extrinsic('dir')
imgePath ='D:/images/';
images = dir([imgePath '*.png']);
I=(mat2gray( imread(([imgPath ,images(1).name]))));
the output of dir function is a structure and its lengths depend on the number of png files in imgePath. When I build the code I encountered the below error:
Subscripting into an mxArray is not supported.
How can I solve this problem?