フィルターのクリア

Simulink: Function Handles Not Supported!

4 ビュー (過去 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 Center および File ExchangeSignal Import and Export についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by