I have two file on matlab: lab1.m and funct.m where lab1.m is main program and funct.m is function y = a*x-b.
To solve on funct.m, I use lab1.c program
I write:
cvx_begin
variable x(4)
expression y
y = funct(x)
minimize (norm (y))
cvx_end
But,I saw error:
Error using cvx/subsref (line 13)
Function ‘subsindex’ is not defined for values of class ‘cvx’.
Error in lab1 (line 18)
y = a(x)
Please help me !
Error using minimize
It looks like you are attempting to index an array with a CVX variable. I’m afraid you simply can’t do that with a CVX variable—it does not satisfy the disciplined convex programming ruleset. CVX models must employ only those functions found in the function reference and combined according to those rules. All other models are rejected. CVX is probably not going to work fro your application.