Matrix multiplication problem

31 views
Skip to first unread message

Florian Brunner

unread,
Jun 24, 2013, 7:11:04 AM6/24/13
to yal...@googlegroups.com
Hello Johan,

I get strange errors when multiplying sdp-variables and numerical vectors in a certain order.

 a=sdpvar(1,2);
 (a*ones(2,1))*eye(2)
;

produces the error
Error using  *
Inner matrix dimensions must agree.

Error in sdpvar/addrightfactor (line 4)
        X.rightfactors{i} = X.rightfactors{i}*R;

Error in sdpvar/mtimes (line 495)
                Z = addrightfactor(Z,Y);


However

a=sdpvar(2,1);
(ones(1,2)*a)*eye(2);

works fine.


Cheers,

Florian

Johan Löfberg

unread,
Jun 24, 2013, 7:16:09 AM6/24/13
to yal...@googlegroups.com
Thank you for reporting

edit  sdpvar/addrightfactor and replace

X.rightfactors{i} = X.rightfactors{i}*R;

with

try

 X
.rightfactors{i} = X.rightfactors{i}*R;
catch
 X
= flush(X);
end


Reply all
Reply to author
Forward
0 new messages