필터 지우기
필터 지우기

wait for user input in app designer

조회 수: 12 (최근 30일)
Shweta Pant
Shweta Pant 2019년 11월 29일
편집: Dhananjay Kumar 2019년 12월 5일
Hello,
I am new to MatLab, I am trying to input 10 numbers using Edit field in the app designer, how ever my code does not wait for the input variables, it takes the 0 value and finishes. Is there a way to hold the program till I have finised inputing the values
I usnig the following way:
x = app.Syst1EditField.Value;
waitfor(x);
Msys=mean (x);
but this also does not work. Please let me know if there is some way to fix this.
  댓글 수: 1
Ajay Kumar
Ajay Kumar 2019년 11월 29일
you want to enter 10 digt number into one editfield ? or 10 separate editfields?

댓글을 달려면 로그인하십시오.

답변 (1개)

Dhananjay Kumar
Dhananjay Kumar 2019년 12월 5일
편집: Dhananjay Kumar 2019년 12월 5일
Add a Text-type edit field (icon: ). This will take the input as character array (Here, default value will be empty character array, not 0). You can write multiple numbers in the edit field separated by spaces.
Add callback to the edit-field by right-clicking on the edit box. This will take you to callback function's code.
Inside the callback function, write this:
x = app.EditField.Value;
xarray = str2num(vxalue); %% This will make numeric array from the input
Msys = mean(xarray);

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by