When does a Simulink.Parameter automatically change its DataType based on Value?
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Workspace Variables and MAT Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!