Index exceeds matrix dimensions. -error

I am keep getting this error
??? Index exceeds matrix dimensions.
Error in ==> gaussmix at 130 m=xs(mod((1:k)-1,n)+1,:); % just include all points several times
Error in ==> matlab at 160 [smiech_means,smiech_variances,smiech_weights] = gaussmix(mfcc_smiech,[],[],8,'hf');

 採用された回答

Matt J
Matt J 2014 年 1 月 21 日
編集済み: Matt J 2014 年 1 月 21 日

0 投票

Use DBSTOP to examine 'k' vs. length(xs) inside gaussmix.
It might also be advisable not to name your main function 'matlab'.

6 件のコメント

Matt J
Matt J 2014 年 1 月 21 日
Monica commented:
How can I use DBSTOP to examine 'k' vs. length(xs) inside gaussmix?
I changed name my function and all time is the same error
Matt J
Matt J 2014 年 1 月 21 日
編集済み: Matt J 2014 年 1 月 21 日
If you execute at the command line
>> dbstop if error
and then re-run, the code execution will pause at the line giving the error
m=xs(mod((1:k)-1,n)+1,:);
You can then examine whether mod((1:k)-1,n)+1 produces a value that is greater than the number of rows in xs. I assume you wrote this code and have reason to think it should not do this.
Monika
Monika 2014 年 1 月 21 日
I didn't write code gaussmix. This code is ready in matlab (it is from toolbox)
Matt J
Matt J 2014 年 1 月 21 日
編集済み: Matt J 2014 年 1 月 21 日
It doesn't appear to be a toolbox command for direct use by users. I can't find it anywhere in the online documentation.
Monika
Monika 2014 年 1 月 21 日
Matt J
Matt J 2014 年 1 月 21 日
編集済み: Matt J 2014 年 1 月 21 日
Well, if you understand what the code is doing (or even if you don't), DBSTOP will help you understand where it's gone wrong, or what bad input you might have given it. Otherwise, you may have to go to the authors of that toolbox for help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

質問済み:

2014 年 1 月 21 日

編集済み:

2014 年 1 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by