Simulink: Function Handles Not Supported!

조회 수: 3 (최근 30일)
John
John 2016년 6월 2일
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에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by