in expressions like X=sdpvar(repmat(n,1,M), repmat(m,1,M)) the second argument of repmat is never used (it's always 1)

212 views
Skip to first unread message

Luigi Glielmo

unread,
May 14, 2017, 4:28:42 AM5/14/17
to YALMIP
Hi,

Congratulations for your work!!!

Obviously I'm not an expert of yalmip but I'm now reading the code my students wrote and cannot explain what above.  

The second argument is always 1, which puzzles me since any argument should give a choice otherwise it should be dropped. 
(I also made little experiments and it seems you cannot use a different number there.)

Is this just a matter of uniformity with the matlab "repmat" or am I missing some details?

Thanks very much

Luigi Glielmo

Johan Löfberg

unread,
May 14, 2017, 4:31:43 AM5/14/17
to YALMIP
to create a matrix of size nxm, you do sdpvar(n,m), to create N matrices of size nxm, you do sdpvar([n n n n .... ], [m m m m ...]) which is sdpvar(repmat(n,1,N),repmat(m,1,N))

Luigi Glielmo

unread,
May 14, 2017, 6:03:41 AM5/14/17
to YALMIP
got it!  it was simple (a posteriori), have a nice Sunday

Luigi
Reply all
Reply to author
Forward
0 new messages