error message ()-indexing must appear last in an index

조회 수: 2 (최근 30일)
Locks
Locks 2013년 5월 20일
Hi,
I have the code below and when I try to run it, I get the error message ()-indexing must appear last in an index expression
V= zeros(size(data17,1),1);
Kappa=1.15;
Theta=0.04;
Sigma=0.39;
Rho=-0.64;
Tau=30/360;
V=(exp(Kappa*Tau).*((data17(:,8)/100)^2)*Kappa^2*Tau+Theta(exp(Kappa*Tau)(1-(Kappa*Tau))-1))/((exp(Kappa*Tau)-1)*Kappa)
doe anybody have an idea what is missing or what I am doing wrong?

채택된 답변

the cyclist
the cyclist 2013년 5월 20일
편집: the cyclist 2013년 5월 20일
MATLAB does not recognize
(A+1)(B+2)
as multiplication of A+1 and B+2. You need, for example
(A+1)*(B+2).
Guessing a bit, but I think you want a multiplication sign after the Theta, and another after
exp(Kappa*Tau)
Otherwise it looks like you are indexing into an array Theta, and then indexing again.
  댓글 수: 1
Locks
Locks 2013년 5월 20일
pefect, that waas exactly the problem, thanks

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by