Sum of empty matrix with constant


(Deep Kiran) #1

I have made a code wherein a loop a matrix can be empty or constant. For example, a = cvx: empty. If I sum(a), then it gives an error
Reference to non-existent field ‘zero’.

Error in cvx_reduce_op (line 11)
if p.reduce && ( nx || ~isempty( p.zero ) ),

Error in cvx/sum (line 25)
y = cvx_reduce_op( P, varargin{:} );

Please help. Thank you


(Mark L. Stone) #2

Can you please show a complete program? Your description is not very clear.