Attempted to access PriorProb(8); index out of bounds because numel(PriorProb)=7.

2 views (last 30 days)
Error: Attempted to access PriorProb(8); index out of bounds because numel(PriorProb)=7.
What does this error mean? I got it when I put in:
W(i,1) = -0.5 * Temp * GroupMean(i,:)' + log(PriorProb(i));
I have 7 prior probability numbers that I used and this error showed up. Need help!!!

Accepted Answer

Matt J
Matt J on 21 Jan 2013
You must prevent the index variable i from reaching a value of 8.
  7 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!