CellOrNoCellRef

Use it to reduce awkward constructs
1,8K download
Aggiornato 27 lug 2005

Nessuna licenza

CELLORNOCELL Use it to reduce awkward constructs

Turn this awkward looking thing:

docnames = get(handles.popupmenu_ChooseReport,'String');
if iscell(docnames)
docname = docnames{get(handles.popupmenu_ChooseReport,'Value')};
else
docname = docnames;
end;

Into this

docnames = get(handles.popupmenu_ChooseReport,'String');
docname = CellOrNoCellRef(docnames, ...
get(handles.popupmenu_ChooseReport,'Value'));

See Also cell cellfun

Key words cell cellstring array matrix


It's not fancy, but it works

Cita come

Michael Robbins (2024). CellOrNoCellRef (https://www.mathworks.com/matlabcentral/fileexchange/8120-cellornocellref), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R12.1
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Cell Arrays in Help Center e MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0