update source block value with GUIDE GUI

6 visualizaciones (últimos 30 días)
David Marquis
David Marquis el 19 de Oct. de 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'

Respuestas (0)

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by