How to get information on a Simulink.Signal data store?
Mostra commenti meno recenti
If I create a data store in the base workspace like so:
DataStore = Simulink.Signal;
DataStore.Description = 'Stores data for a variable.';
DataStore.DataType = 'double';
DataStore.Complexity = 'real';
DataStore.Dimensions = 1;
DataStore.SamplingMode='Sample based';
DataStore.SampleTime = 0.1;
how can I later get this data via the Command Window, specifically the DataType? I can access it by double-clicking the workspace variable (shown below), but I need to get this data programmatically for a script.

Risposta accettata
Più risposte (1)
Fangjun Jiang
il 12 Dic 2018
0 voti
Just like you did in the script, as long as you know the Simulink.Signal object name.
To get the data type: DataStore.DataType or get(DataStore,'DataType')
To set the data type: DataStore.DataType='single' or set(DataStore,'DataType','single')
Categorie
Scopri di più su Simulink in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!