File Exchange

image thumbnail

CellOrNoCellRef

version 1.0.0.0 (488 Bytes) by Michael Robbins
Use it to reduce awkward constructs

0 Downloads

Updated 27 Jul 2005

No License

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

Cite As

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

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R12.1
Compatible with any release
Platform Compatibility
Windows macOS Linux