Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: ???  Index exceeds matrix dimensions.
Date: Thu, 26 May 2011 05:27:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <irkob8$hd4$1@newscl01ah.mathworks.com>
References: <irklop$bg9$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-04-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1306387624 17828 172.30.248.35 (26 May 2011 05:27:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 26 May 2011 05:27:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:728774

"Li Wen " <loo_liwen1991@hotmail.com> wrote in message <irklop$bg9$1@newscl01ah.mathworks.com>...
> ........
> When I simulate my file it gave me the error "???  Index exceeds matrix dimensions" which I can't find any mistake, please help me.
> .......
>     BetDecision(k)=0; %'0' signifies Gambler Betting Player
> .......
> ... BetProbability(BetDecision(k-1),k)=BetProbability(BetDecision(k-1),k)*0.9/1.1;
> .......
- - - - - - - - - -
  In some cases you are setting 'BetDecision' values to zero and you are subsequently using these same 'BetDecision' values as indices in 'BetProbability'.  Indices to arrays should never be zero.  Matlab will complain.

Roger Stafford