How to use eval and disable the edit box or drop down?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
raghavendra kandukuri
il 21 Mag 2019
Commentato: raghavendra kandukuri
il 21 Mag 2019
HI,
can we use eval, and disable the dropdown or edit box? for example:
the below code can visit 16 fields(editboxes) and set the value coming frim G_PB, similarly i would like to do for disableing
Thanks in Advance
for i=1:16
eval(['set(handles.PwrBlg' num2str(i) ',''String'',G_PB)']);
end
0 Commenti
Risposta accettata
Stephen23
il 21 Mag 2019
Do NOT use eval for trivial code like this!
Much better is to read the documentation on dynamic fieldnames:
For your code, something like this:
fld = sprintf('PwrBlg%d',i);
set(handles.(fld),'String',G_PB)
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Environment and Settings 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!