CellOrNoCellRef

Version 1.0.0.0 (488 octets) par Michael Robbins
Use it to reduce awkward constructs
1,8K téléchargements
Mise à jour 27 juil. 2005

Aucune licence

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

Citation pour cette source

Michael Robbins (2025). CellOrNoCellRef (https://www.mathworks.com/matlabcentral/fileexchange/8120-cellornocellref), MATLAB Central File Exchange. Extrait(e) le .

Compatibilité avec les versions de MATLAB
Créé avec R12.1
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Cell Arrays dans Help Center et MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.0.0.0