필터 지우기
필터 지우기

How to update AppUI Edit Field Text from different script ?

조회 수: 4 (최근 30일)
Sujay Muniraju
Sujay Muniraju 2023년 7월 26일
댓글: Sujay Muniraju 2023년 7월 26일
I have above Percentage Text in AppUI.mlapp , with code
with the separate function script getpercentage.m , I'm trying to update above text dynamically.
I appreciate any help on this query.
Thanks in Advance.

채택된 답변

Kevin Holly
Kevin Holly 2023년 7월 26일
To call the the getpercentage function successfully, you need to feed it the property variables as an input, so add "app" as an input.
function [] = getpercentage(app)
%Update text of Edit field
for ii = 1:100
percentage = num2str(ii);
app.PercentageEditField.Value = percentage;
end
end
Then simply call the function within a call back.
function PercentageEditFieldValueChanged(app, event)
getpercentage(app)
end
Is there a reason why you want to iterate through 100 values for the editfield? If it is for testing purposes, you could use TestCase.
For example:
tc = matlab.uitest.TestCase.forInteractiveUse;
for ii = 1:100
percentage = num2str(ii);
tc.type(app.PercentageEditField,percentage)
end
  댓글 수: 3
Kevin Holly
Kevin Holly 2023년 7월 26일
Have you considered using uiprogressdlg?
Sujay Muniraju
Sujay Muniraju 2023년 7월 26일
Thanks a lot, I should, this is second times I got suggest to use uiprogressdlg, first time when i asked mathworks about why Matlab live script doesn't have clear output option for particular to disp statments in live script,
Ex: if I'm running log values from a loop because when it goes overbound we can't see current log value on display usually.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by