# Reshape error lin 93 and line 6

(Elham) #1

I have error as
"Error using reshape
Size arguments must be real integers.

Error in cvx/cat (line 93)
x = reshape( x, numel(x) / rsiz, rsiz );

Error in cvx/vertcat (line 6)
y = cat( 1, varargin{:} );
"
and mu code is
%%%%%%%%%%%%%%%%%%%%%%%%
cvx_begin sdp
variable L1(2,1)
variable Ahat(2,2)
variable sigma1(4,4) symmetric
%%
Abar=[A zeros(2,2);A-L1H -(Ahat-L1H)];
Bbar=[B zeros(2,1);B -L1];%42
Hbar=[H1;H1-L1
HH2]
Ebar=[E zeros(1,2)];
Q=sqrt([0.00125
eye(2,2) zeros(2,1);zeros(1,2) (0.00125)]);
%% cost function
minimize (trace(sigma1))
%% LMI
[sigma1 sigma01Abar’ BbarQ sigma01*Ebar’

``````  (sigma01*Abar')'                   sigma01 -alpa*(Hbar*Hbar')        zeros(4,3)               zeros(4,1)

(Bbar*Q)'                          zeros(3,4)                        eye(3,3)                zeros(3,1)

(sigma01*Ebar')'                   zeros(1,4)                       zeros(1,3)               alpa

]>=0
cvx_end
``````

I couldn’t understand what is the error?

(Elham) #2

based on your before solution i correct it but now i have error as

“invalid numeric values (NaNs) may not be used in CVX expressions.”
what is that?

(Mark L. Stone) #3

Look at every element of every MATLAB variable in the expression for which you get the error message. Presumably, at least one of them is a NaN rather than a (double precision) number.

(Elham) #4

i correct my lmi again but yet I have nan problem and unfortunately I couldnt find the problem , I want to ask you if it is possible please help me to find it.
[sigma1-alpa*(HbarHbar’) ( Abarsigma01) zeros(4,1) Bbar*Q

``````  (Abar*sigma01)'                      sigma01                sigma01*Ebar'             zeros(4,3)

zeros(1,4)                          (sigma01*Ebar')'          alpa                  zeros(1,3)

(Bbar*Q)'                            zeros(3,4)           zeros(3,1)                eye(3,3)

]>=0
``````

Error in (line 80)
[sigma1-alpa*(HbarHbar’) ( Abarsigma01) zeros(4,1) Bbar*Q

(Mark L. Stone) #5

Look at the value of everything in that expression which is not a CVX varaible or expression. Presumably something is NaN, not a number.