When does a Simulink.Parameter automatically change its DataType based on Value?
이전 댓글 표시
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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!