. How do I Change the value in The Edit FIeld Box ( such as- Sample No : 01 , Sample no :02... so on) utpo 10 samples, by clicking on pushbutton.?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I Have Created a GUI with app designer in MATLAB 2020. I am trouble in finding this, I want 10 Samples to be displayed on the app.EditField text Box , one-by-one with the click on the Push Button !!
0 Commenti
Risposte (1)
Shanmukha Voggu
il 3 Set 2021
Hi Shaik Asif,
Customizing call back functions and startupFnc helps to achieve the above task,
1)Edit the startup function of the app as
function startupFcn(app)
app.EditField.Value="Sample No : 01"; %initial value displayed
end
2)Edit the call back of the push button as
function ButtonPushed(app, event)
newStr = extractAfter(app.EditField.Value,": "); %extracting the sample number into string
if newStr=="09"
app.EditField.Value="Sample No : 10";
elseif newStr=="10"
app.EditField.Value="Sample No : 01";
else
app.EditField.Value=replace(app.EditField.Value,newStr,"0"+num2str(str2num(newStr)+1)); %incrementing the sample number and updating it
end
end
0 Commenti
Vedere anche
Categorie
Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!