How to update AppUI Edit Field Text from different script ?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sujay Muniraju
el 26 de Jul. de 2023
Comentada: Sujay Muniraju
el 26 de Jul. de 2023
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.
0 comentarios
Respuesta aceptada
Kevin Holly
el 26 de Jul. de 2023
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 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!