Simulink: Function Handles Not Supported!

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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by