Data store memory can not set initial value using set_param
8 次查看(过去 30 天)
显示 更早的评论
I make Model.slx and open this file.
And put a Data Store Memory.
MATLAB Command window
listMask = find_system('Model','LookUnderMasks','all','BlockType','DataStoreMemory');
get_param( listMask, 'Initialvalue' ) Ans= '0'
get param is OK(I can read initial value on DataStoreMemory). But
set_param(listMask(1),'InitialValue','test')
=>Invalid Simulink object specifier
I can not set initial value ('test') using set_param
Please tell me how to set the initial value using set_param.
0 个评论
采纳的回答
ES
2017-3-24
use this
set_param(listMask{1},'InitialValue','test')
listMask(1) and listMask{1} are different.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!