Error using + Matrix dimensions must agree

Hello all! I keep on getting this error in my model:
Error using +
Matrix dimensions must agree.
It refers to this line:
parms = chol(results.cov+0.001*eye(size(parm)))'*randn(size(parm)) + parm;
I am not very experienced in MATLAB programming, can anybody see anything wrong?
Thank you,
Oana

답변 (1개)

Wayne King
Wayne King 2013년 3월 18일

0 개 추천

You have to look at the size of results.cov and parm. Are they compatible for addition?
You can use
size(results.cov)
size(parm)

댓글 수: 2

Oana
Oana 2013년 3월 18일
Thank you, I have checked.
I get
198 198
for the first one
and
198 1
for the second one.
Is there any fix to it?
Walter Roberson
Walter Roberson 2013년 3월 18일
What result do you want? Do you want parm(K) added to each results.cov(K,:) or do you want it added to each results.cov(:,K) or do you want the results.cov to become 198 x 1 ?

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

카테고리

제품

질문:

2013년 3월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by