mex -r2018a mextst.c
Building with 'gcc'.
Warning: You are using gcc version '7.5.0'. The version of gcc is not
supported. The version currently supported with MEX is '6.3.x'. For a
list of currently supported compilers see:
https://www.mathworks.com/support/compilers/current_release.
MEX completed successfully.
mextst ([1, 2])
mxGetPr: 1.000000, 2.000000
mxGetDoubles: 1.000000, 2.000000
mextst ([1+i, 2+2i])
Error using mextst
Array must not be complex.
%% Commenting out "//pr = mxGetPr" + following line and recompile
mextst ([1+i, 2+2i])
%% MATLAB CRASH!!!!
%% Commenting out "//d = mxGetDoubles" + following line and recompile