update source block value with GUIDE GUI

7 次查看(过去 30 天)
I'm trying to build (and learn) Matlab GUIs. I have a small model that has several source blocks that I wan to control with my GUI. I cannot seem to get the source value to update.
Obviously, I can change the block value directly while it's simulation is running, but it won't let me do so indirectly through the GUI. Here's my GUI code. I can the error on the last line.
% Get the value input to the edit block
Count_Update = get(hObject,'Value');
% Update the model's Sensor Count source block
set_param([bdroot '/Sensor Count'],'Value',Count_Update);
The error is:
Error using SpookfishConfiguration_GUI>edit_SensorCount_Callback (line 92)
Invalid setting in Constant block 'Sensor Count' for parameter 'Value'

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by