Define Array data type
Ältere Kommentare anzeigen
Hello,
I have a Simulink model, where I need to define some custom data types. For that, in a .m file I a writting something like this:
tSpeed = Simulink.AliasType;
tSpeed.BaseType = 'single';
tSpeed.Description = '[Kmh]';
tDistance= Simulink.AliasType;
tDistance.BaseType = 'single';
tDistance.Description = '[meters]';
The idea is to set the datatype of the input/output ports of the simulink model to 'tSpeed' or 'tDistance', in spite of setting them to 'single' datatype.
Now, my problem is the following: I want to define another datatype which is not just a 'single', but is an array of 6 single numbers.
Does anybody know how can I do that?
Akzeptierte Antwort
Weitere Antworten (1)
Fangjun Jiang
am 19 Mai 2011
As it indicates, Simulink.AliasType allows you to designate MATLAB variables as aliases for signal and parameter data types. If you want to specify your signal as a vector signal, you can specify the Dimensions of the signal.
a=Simulink.Signal;
a.Dimensions=[1 6]
3 Kommentare
Iban
am 19 Mai 2011
Fangjun Jiang
am 19 Mai 2011
My understanding is the Simulink.AliasType is for custimizing data types only, you know, single, interger, unsigned interger, etc.
What did you do to specify the data type of your Inport?
Iban
am 19 Mai 2011
Kategorien
Mehr zu Sources finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!