Simulink: Function Handles Not Supported!

2 vues (au cours des 30 derniers jours)
John
John le 2 Juin 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

Réponses (0)

Catégories

En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by