The function square_abs has only one-line code : y = square( cvx_linearize( x, ‘cabs’ ) );
typing square_abs(-2) in the MATLAB command window, it throws a error as follows:
Error using cvx_linearize (line 42)
Invalid mode: cabs
Error in square_abs (line 13)
y = square( cvx_linearize( x, ‘cabs’ ) );
After adapting the code as follows y = square( cvx_linearize( x, ‘abs’ ) ), it works.
MATLAB version: 9.0 (R2016a)
OS: Windows 7 amd64 version 6.1
Java version: 1.7.0_60
Verfying CVX directory contents: No missing files.
The latest version of square_abs change the codes to y = conj( x ) .* x;
Also add a error check procedure: error( nargchk( 1, 1, nargin ) );
However, nargchk will be removed in a future release. Use NARGINCHK instead.
Sooooo many warning happens when using the the latest version of CVX in MATLAB 2016a.