Azzera filtri
Azzera filtri

Integrate the input of an EditField in AppDesign into the code

1 visualizzazione (ultimi 30 giorni)
Hello everyone,
I would like to first say thank you for any help provided :)
I have two EditFields in my GUI (the app designer) and i would like to multiply what the user inputs to create a while loop:
TTime = app.TotalTimeEditField; %Time the user chooses
FPSec = app.FPSEditField; %Amount of frames the user would like
app.frames = TTime * FPSec; %Calculating Frames per Second
while 1:lenght(app.frames) %While 1:the amount of frames already calculated based on what the user has inputted
...
I am not sure why it does not let me multiply, how can I correct this? I get this error on my "Calculating Frames per Second" line:
Undefined function 'mtimes' for input arguments of type 'matlab.ui.control.EditField'.

Risposta accettata

Yency Perez
Yency Perez il 25 Apr 2021
Modificato: Yency Perez il 25 Apr 2021
I needed to access the values stored on the fields:
TTime = app.TotalTimeEditField.Value; %Time the user chooses
FPSec = app.FPSEditField.Value; %Amount of frames the user would like
app.frames = TTime .* FPSec; %Calculating Frames per Second
I hope this helps anyone else!

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by