フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Error: Index exceeds matrix dimensions.

1 回表示 (過去 30 日間)
dpr
dpr 2012 年 5 月 14 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi I am getting this error "Index exceeds matrix dimensions" for the following:
c(2:T-1)=(epsilon(2:T-1)'.*n(2:T-1))*Fn+(1+Fk)*k(1:T-2)-k(2:T-1);
How can I solve it? thanks
  3 件のコメント
dpr
dpr 2012 年 5 月 14 日
the values are these:
k=[k0 0.01*ones(size(1:T-2))]
n=ones(size(1:T-1))
epsilon(1:T,1)=2
Sargondjani
Sargondjani 2012 年 5 月 14 日
it looks fine, but you should check the sizes of epsilon, n and k
you can use 'dbstop' so matlab stops just before this command, then you can see in the workspace what their size is

回答 (1 件)

Jan
Jan 2012 年 5 月 14 日
This is a task for the debugger, while it is impossible to guess the reason of the problem based on the information you have posted.
Either use dbstop if error or set a breakpoint in the M-file directly. Then inspect the sizes of the variables:
disp(T);
disp(size(epsilon))
disp(size(n));
disp(size(k))
Then you will find out, which of the variables has an unexpected size.

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by