<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265268</link>
    <title>MATLAB Central Newsreader - subsindex error</title>
    <description>Feed for thread: subsindex error</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sun, 08 Nov 2009 04:58:01 -0500</pubDate>
      <title>subsindex error</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265268#692958</link>
      <author>Pramod chakrapani</author>
      <description>function [c,c_cnt] = kmeans(pts, nc)&lt;br&gt;
&lt;br&gt;
mn = min(pts);&lt;br&gt;
mx = max(pts);&lt;br&gt;
&lt;br&gt;
[length, dim] = size(pts);&lt;br&gt;
&lt;br&gt;
c_cnt = zeros(nc,dim);&lt;br&gt;
.&lt;br&gt;
..&lt;br&gt;
...&lt;br&gt;
....&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
return&lt;br&gt;
&lt;br&gt;
when i try to run in debug mode. matlab is giving this error&lt;br&gt;
&lt;br&gt;
??? Error using ==&amp;gt; subsindex&lt;br&gt;
Function 'subsindex' is not defined for values of class 'struct'.&lt;br&gt;
&lt;br&gt;
Can anyone please tell me whats the problem?&lt;br&gt;
&lt;br&gt;
Regards&lt;br&gt;
Pramod</description>
    </item>
    <item>
      <pubDate>Sun, 08 Nov 2009 23:13:48 -0500</pubDate>
      <title>Re: subsindex error</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265268#693090</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
&quot;Pramod chakrapani&quot; &amp;lt;pramod1561@gmail.com&amp;gt; wrote in message &lt;br&gt;
news:hd5j4p$5mu$1@fred.mathworks.com...&lt;br&gt;
&lt;br&gt;
*snip*&lt;br&gt;
&lt;br&gt;
&amp;gt; when i try to run in debug mode. matlab is giving this error&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ??? Error using ==&amp;gt; subsindex&lt;br&gt;
&amp;gt; Function 'subsindex' is not defined for values of class 'struct'.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Can anyone please tell me whats the problem?&lt;br&gt;
&lt;br&gt;
That means MATLAB thinks you're trying to use a struct array as the index &lt;br&gt;
into a variable.&lt;br&gt;
&lt;br&gt;
x = 1:10;&lt;br&gt;
s = struct('y', 1);&lt;br&gt;
x(s)&lt;br&gt;
&lt;br&gt;
Use &quot;DBSTOP IF ERROR&quot; to help you locate the cause of this problem (either &lt;br&gt;
where the index you expected to be a double array is becoming a struct &lt;br&gt;
array, or where the function you're trying to call on a struct is being &lt;br&gt;
interpreted as a variable) and fix it.&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com&lt;br&gt;
comp.soft-sys.matlab (CSSM) FAQ: &lt;a href=&quot;http://matlabwiki.mathworks.com/MATLAB_FAQ&quot;&gt;http://matlabwiki.mathworks.com/MATLAB_FAQ&lt;/a&gt; </description>
    </item>
  </channel>
</rss>

