update source block value with GUIDE GUI

7 visualizzazioni (ultimi 30 giorni)
David Marquis
David Marquis il 19 Ott 2015
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'

Risposte (0)

Categorie

Scopri di più su Modeling in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by