Apply exist on cell array?

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
bluesaturn (54)
6/11/2010 10:49:51 AM
comp.soft-sys.matlab 209991 articles. 11 followers. lunamoonmoon (258) is leader. Post Follow

2 Replies
1661 Views

Similar Articles

[PageSpeed] 21

"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
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
Walter
6/11/2010 4:25:36 PM
Reply: