Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Invalid setting of assignin() when used in App Designer

1 visualizzazione (ultimi 30 giorni)
Philipp Küsters
Philipp Küsters il 4 Gen 2018
Chiuso: Philipp Küsters il 4 Gen 2018
I start an mlapp-file (app designer) with an m-file. Also i assign three variables in the base workspace before.
%m-file
assignin('base', 'process_time', '0');
assignin('base', 'start_process', '0');
assignin('base', 'force_stop', '0');
new_app = gia_app;
The app has two buttons who are supposed to change the value of two of the variables i assigned before.
%-mlapp-file
% Button pushed function: start_btn
function start_btnPushed(app, event)
assignin('base', 'start_process', '1'),
set(app.start_btn, 'Enable', 'off');
end
% Button pushed function: stop_btn
function stop_btnButtonPushed(app, event)
assignin('base', 'force_stop', '1');
end
When i run the m-file, I get the error-message:
Error using gia_exe (line 12)
Invalid setting in 'gia_sim/Notstopp' for parameter 'Value'. Error using gia_exe (line 12)
Invalid setting in 'gia_sim/Start button' for parameter 'Value'.
Even weirder, when i start the mlapp-file (app) without the m-file, I don't get the error-message and everything works as intended. Any ideas?
  1 Commento
Philipp Küsters
Philipp Küsters il 4 Gen 2018
Apparently u have to not use the ' ' when assigning a number. Correct would be:
assignin('base', 'start_process', 1),

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by