Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: subsindex error
Date: Sun, 8 Nov 2009 18:13:48 -0500
Organization: The MathWorks, Inc.
Lines: 31
Message-ID: <hd7j9h$rr4$1@fred.mathworks.com>
References: <hd5j4p$5mu$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1257721969 28516 172.31.44.65 (8 Nov 2009 23:12:49 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 8 Nov 2009 23:12:49 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:583424



"Pramod chakrapani" <pramod1561@gmail.com> wrote in message 
news:hd5j4p$5mu$1@fred.mathworks.com...

*snip*

> when i try to run in debug mode. matlab is giving this error
>
> ??? Error using ==> subsindex
> Function 'subsindex' is not defined for values of class 'struct'.
>
> Can anyone please tell me whats the problem?

That means MATLAB thinks you're trying to use a struct array as the index 
into a variable.

x = 1:10;
s = struct('y', 1);
x(s)

Use "DBSTOP IF ERROR" to help you locate the cause of this problem (either 
where the index you expected to be a double array is becoming a struct 
array, or where the function you're trying to call on a struct is being 
interpreted as a variable) and fix it.

-- 
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ