Problems with using mxarrays with the step function in MATLAB Coder
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sharan Duggirala
am 18 Apr. 2015
Bearbeitet: Sharan Duggirala
am 20 Apr. 2015
I'm trying to convert my image processing code on MATLAB into C by using MATLAB coder. using 'imread' needs a coder.entrinsic declaration. However, this means that the output to imread will be an mxArray. This is a problem as I cannot use this with the step function. The error report from code generation is shown below:

Does anyone know a way around this? Help will be very much appreciated!
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Ketan
am 19 Apr. 2015
You can assign the output of the extrinsically called imread to a variable of known type. For example:
% Assume IMREAD output is real uint8 [480 x 640]
I = zeros([480,640],'uint8');
I = imread(...);
Then it will not be treated as an mxArray which can only be used in a limited set of circumstances. See the following documentation for information on converting mxArrays to known types:
Siehe auch
Kategorien
Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!