Problems with using mxarrays with the step function in MATLAB Coder

3 次查看(过去 30 天)
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!

采纳的回答

Sharan Duggirala
Sharan Duggirala 2015-4-20
编辑:Sharan Duggirala 2015-4-20
The answer has been found here for anyone wondering about it.
Thank you for your help!

更多回答(1 个)

Ketan
Ketan 2015-4-19
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:

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by