I am dealing with a rather large optimization problem (using MOSEK). To remind myself of the decision variables in this problem, I decided to try to store the variable names in a cell array in a struct, as desribed by MOSEK. However, I am unsure of how to do this. The relevant fragment of my code is listed below:
JiSet = 1:6; TiSet = [7 8]; nL = length(TiSet);
P = struct;
P.names.var{1} = 'gamma_i(k+1)'; % my first constraint
P.names.var{2:1+nL,1} = cellstr(strcat('nu_',int2str(TiSet(:)),'(k+1)')); % a series of constraints of varying length
When I run the above code I get the following error:
The right hand side of this assignment has too few values to satisfy the left hand side.
However, if I enter strcat('nu_',int2str(TiSet(:)),'(k+1)') in my command window, it shows an ans variable that is a 2x1 cell (as desired). How do I assign the values in this cell to the 2:1+nL,1 entries in the P.names.var cell?