Apply exist on cell array?

  • Follow


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
0
Reply bluesaturn (54) 6/11/2010 10:49:51 AM

"bluesaturn[at]kellnerweg.de" <bluesaturn@kellnerweg.de> wrote in message <774166218.318291.1276271421713.JavaMail.root@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
0
Reply Wayne 6/11/2010 4:13:04 PM


Wayne King wrote:
> "bluesaturn[at]kellnerweg.de" <bluesaturn@kellnerweg.de> wrote in 
> message 
> <774166218.318291.1276271421713.JavaMail.root@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.
0
Reply Walter 6/11/2010 4:25:36 PM

2 Replies
360 Views

(page loaded in 0.028 seconds)

Similiar Articles:













7/15/2012 1:31:15 PM


Reply: