Call several handles with the same name
Informazioni
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
Mostra commenti meno recenti
I need a bit of help. I have 40 handels called handles.rgb1-handles.rgb40. Is it possible to call all of them without calling them one at the time?
1 Commento
Next time use a non-scalar structure rather then putting an index into the fieldnames. Then your code will be a lot simpler.
Risposte (1)
I think dynamic field names are what you want to use.
for j = 1:40
ThisHandle = handles.(['rgb' num2str(j)]); %Use dynamic field names
%Do something with ThisHandle
end
Questa domanda è chiusa.
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!