Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

How I can modify StopTime with an Inputdlg?

3 views (last 30 days)
alfred
alfred on 28 Jul 2017
Closed: MATLAB Answer Bot on 20 Aug 2021
Hello,
I need that the user can select diferent StopTime depends on the system. I create an inputdlg for introduce the value of StopTime that the user wants but how I can do for change the value of StopTime inside setparam('systemname','StopTime',...)
I try to put like a variable.. but it doesn't works...
PART OF PROGRAM:
ParamSimulacio = {'Introdueix el temps total de simulació','Introdueix el temp de mostreig'};
titol = 'Selecció del temps de simulació';
num_linies = 1;
valorsperdefecte = {'0','0'};
cuadredialeg = inputdlg(ParamSimulacio,titol,num_linies,valorsperdefecte);
TempsSimulacio = str2num(cell2mat(cuadredialeg));
Tstop=TempsSimulacio(1,1);
Ti=TempsSimulacio(2,1);
set_param('Tancs_Dades_Reals','StopTime',Tstop,'FixedStep','Ti');
Thanks!

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!