필터 지우기
필터 지우기

Integrate the input of an EditField in AppDesign into the code

조회 수: 1 (최근 30일)
Yency Perez
Yency Perez 2021년 4월 25일
편집: Yency Perez 2021년 4월 25일
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'.

채택된 답변

Yency Perez
Yency Perez 2021년 4월 25일
편집: Yency Perez 2021년 4월 25일
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!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by