Asked by Chien-Chia Huang
on 15 Jun 2011

Hi, I am using "gamultiobj" to solve my problem. I, however, have no idea why the error message occurred

??? Error using ==> mtimes Inner matrix dimensions must agree.

Error in ==> col_mop>@(x)x'*(B'*B)*x at 50 fun1 = @(x) x'*(B'*B)*x;

My objective function is coded as follows

fun1 = @(x) x'*(B'*B)*x; fun2 = @(x) x'*x; bifun = @(x) [fun1(x) fun2(x)];

The dimension of B'*B is *m* so x is an *m*-by-1 vector. The syntax for gamultiobj is

X = gamultiobj(FITNESSFCN,NVARS,A,b,Aeq,beq,LB,UB,options)

I have properly input the number of decision variables (NVARS) as m but the error message shows. I also check the dimensions using the command "whos" which showed what I wanted. Is there anything wrong?

Thanks in advance.

Answer by Paulo Silva
on 15 Jun 2011

Accepted Answer

Error correction...inner matrix dimensions must be same??? how to correct ?

(look at Matt Fig answer on that question)

Loginatorist
on 15 Jun 2011

@Chhien-Chia,

Show us the output of the following:

size(x) % I mean the argument to fun1 here...

size(B)

Chien-Chia Huang
on 15 Jun 2011

Chien-Chia Huang
on 16 Jun 2011

Log in to comment.

Opportunities for recent engineering grads.

Apply Today
## 0 Comments

Log in to comment.