Simulink: Function Handles Not Supported!

3 views (last 30 days)
John
John on 2 Jun 2016
I have a lengthy Matlab program, parts of which I'd like to embed into a Simulink program. In the Matlab program there are numerous functions that I call as part of "classes" that involve function handles. How can I use these in Simulink's Code Blocks? I keep getting the Simulink error "Function handles in structures are not supported", when I try to add even just the class declaration in a code block (class = someClass;)
As reference, here is an example of the main Matlab program; it calls various functions.
% Main Matlab File:
class = someClass;
output1 = class.object1(input1);
output2 = class.object2(input2);
And here is the file that holds these classes. In reality, each "class file" has dozens of functions (though I listed just two), so it would be cumbersome to break each function into a separate file.
% Filename: someClass.m
function out = someClass
out.object1 = @object1;
out.object2 = @object2;
...
end
function y = object1(...)
...
end
function y = object2(...)
...
end

Answers (0)

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!