I would like to make a nested cell array as follows:
tag = {'slot1'}
info = {' name' 'number' 'IDnum'}
x = {tag , info}
And I want to be able to call x(tag(1))
and have it display 'slot1'
. Instead I am getting this error:
??? Error using ==> subsindex
Function 'subsindex' is not defined for values of class 'cell'.
If I call x(1)
MATLAB displays {1x1 cell}
. I want to be able to access the first cell in the list x
so I can do a string comparison with another string.
I know I can write my own class to do this if MATLAB's built in class does not work but is there a simple trick to solve this problem?