When does a Simulink.Parameter automatically change its DataType based on Value?
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Workspace Variables and MAT Files en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!