Two problems: 1) select a subset of a matrix in cvx_optimization, 2) take inverse of a matrix. To be concrete, I have an NAxN matrix (Theta) and I want to select N specific rows based on some constraints to get NxN matrix. My problem looks like
cvx_begin
cvx_solver GUROBI
variable P(N) integer;
maximize –
subject to
for i=1:N
P(i) >= A*(i-1) + 1;
P(i) <= i*A;
end
MatR = Theta(P,:);
u == inv(MatR)*--; (I use inv(MatR) to optimize over different variable that defines a convex objective function)
cvx_end
In selecting the subset of matrix, MatR, I get the error: conversion to double from cvx is not possible. Much Appreciate any help.
-Aj