When does a Simulink.Parameter automatically change its DataType based on Value?
Afficher commentaires plus anciens
I am using a Simulink.Parameter in my model, and I noticed the DataType changes automatically. The code below demonstrates the behavior I am seeing. If I specify a single Value then it switches the DataType from 'auto' to 'single':
>> x = Simulink.Parameter;
>> x.DataType
ans =
'auto'
>> x.Value = single(3);
>> x.DataType
ans =
'single'
But then any time I change the Value field, the DataType gets modified:
>> x.Value = 3;
>> x.DataType
ans =
'auto'
Is that expected behavior? Under what conditions will the DataType be changed automatically? I would like to specify the data type once, and for it to never be changed.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Workspace Variables and MAT Files dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!