How to use matlab class handle in simulink

Is it possible to use such an class in Simulink? I successfully worked with static methods, but it would be nice to use a handle class. The method should be fed with parameter b by a simulink connection. Using a Matlab function block in simulink I get an error "b not known".
classdef Example < handle
properties
a
end
methods
function ex = Example(a)
ex.a = a;
end
function out = compareWith(ex,b)
out = min(ex.a,b);
end
end
end

1 Kommentar

Stefano Cardarelli
Stefano Cardarelli am 28 Mär. 2020
So... I am at your same point 8 years later... have you solved it? I'd really need some help right now!

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Produkte

Gefragt:

am 15 Feb. 2012

Kommentiert:

am 28 Mär. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by