Filter löschen
Filter löschen

Integrate the input of an EditField in AppDesign into the code

1 Ansicht (letzte 30 Tage)
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'.

Akzeptierte Antwort

Yency Perez
Yency Perez am 25 Apr. 2021
Bearbeitet: Yency Perez am 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!

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by