From: bluesaturn[at]kellnerweg.de on
I have a 7x1 cell array called X.

exist(X) does not work as I am not allowed to apply it on type cell.
Is there any solution for this problem, please?

Thank you.
Blue
From: Wayne King on
"bluesaturn[at]kellnerweg.de" <bluesaturn(a)kellnerweg.de> wrote in message <774166218.318291.1276271421713.JavaMail.root(a)gallium.mathforum.org>...
> I have a 7x1 cell array called X.
>
> exist(X) does not work as I am not allowed to apply it on type cell.
> Is there any solution for this problem, please?
>
> Thank you.
> Blue

Hi Blue, you have to include the name of the variable, be it a cell array or not, in single quotes.

A = cell(2,1);
exist('A')

Hope that helps,
Wayne
From: Walter Roberson on
Wayne King wrote:
> "bluesaturn[at]kellnerweg.de" <bluesaturn(a)kellnerweg.de> wrote in
> message
> <774166218.318291.1276271421713.JavaMail.root(a)gallium.mathforum.org>...
>> I have a 7x1 cell array called X.
>>
>> exist(X) does not work as I am not allowed to apply it on type cell.
>> Is there any solution for this problem, please?
>>
>> Thank you.
>> Blue
>
> Hi Blue, you have to include the name of the variable, be it a cell
> array or not, in single quotes.
>
> A = cell(2,1);
> exist('A')
>
> Hope that helps,


To which I would add that unless you have specific reason not to, you should use

exist('A','var')

just in case your variable name happens to be the same as the name of a
function or the like.