Integrate the input of an EditField in AppDesign into the code

1 vue (au cours des 30 derniers jours)
Yency Perez
Yency Perez le 25 Avr 2021
Modifié(e) : Yency Perez le 25 Avr 2021
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'.

Réponse acceptée

Yency Perez
Yency Perez le 25 Avr 2021
Modifié(e) : Yency Perez le 25 Avr 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!

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by