How to toggle multiple Switches from a push button and go to all ValueChangedFn?

1 view (last 30 days)
I am using App Designer and I have multiple Switches starting on 'off'. I created a button to start all -
% Button pushed function: StartallButton
function StartallButtonPushed(app, event)
if app.StartallButton.Text == 'Start all'
app.StartallButton.Text = 'Stop all ';
app.Switch_Ducor.Value='1';
Switch_DucorValueChanged(app, event) ; %loop inside
app.Switch_Caol.Value='1';
Switch_CaolValueChanged(app, event) ;%loop inside
else
app.StartallButton.Text = 'Start all';
app.Switch_Ducor.Value='0';
end
Since there is a loop(infinite) inside each callback I cannot toggle all Switches. Is there anyway around it? a way to toggle all switches and go to all callbacks for all Switches?

Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!