That is the error you get when you use coder.extrinsic and fail to declare the output before calling the extrinsic function. If you only want to pass the output to extrinsic functions, you don't have to, but if you want to index into the result, you have to pre-define its size and type. For example, suppose foo(x) returns a result with the same size and type as x. Then you could write
y = x; y = foo(x);
Or if foo always returns a 4-by-1 array of int32's, you would write
y = zeros(4,1,'int32'); y = foo(x);
This tells the compiler how to deconstruct the data structure that comes back from MATLAB when the function foo is called with x as input
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Explore similar technical troubleshooting questions and verified MATLAB solutions: