I am creating a simulation which I will port to another language myself. So I don't need to use code generation capabilities of Simulink. How to turn it's attempts to allow code generation OFF?
For example, I have the following code inside MATLAB Function
block:
function OutImage = ResizeCropPad(InImage, Width, Height)
%#codegen
%coder.extrinsic('imresize');
% resizing to defined height
scale = Height/size(InImage,1);
InImage = imresize(InImage, scale);
% cropping to defined width
if Width<size(InImage,2)
padarray(InImage, [0 size(InImage,2)-Width], 0, 'both');
elseif Width>size(InImage,2)
b = floor((Width-size(InImage,2))/2);
InImage = InImage(:,b:b+Width-1,:);
end
OutImage = InImage;
and it gives an error
The function 'imresize' is not supported for standalone code generation. See the documentation for coder.extrinsic to learn how you can use this function in simulation.
If I uncomment coder.extrinsic('imresize')
line I get new error
Expected either a logical, char, int, fi, single, or double. Found an mxArray. MxArrays are returned from calls to the MATLAB interpreter and are not supported inside expressions. They may only be used on the right-hand side of assignments and as arguments to extrinsic functions.
Addressing line 11, with if
.
Why? Is it possible to completely disable code generation, for example at model level?