MATLAB: Library not loaded: @rpath/lib​mwhgbuilti​ns.dylib

integritylibraryloadedMATLABnotplotprotectionsystem

Best Answer

It appears from the error that you included that MATLAB cannot find the "libmwhgbuiltins.dylib" possibly because Apple's System Integrity Protection software is preventing MATLAB from accessing the library file.
Below is a link to a workaround where you copy the library from the "matlabroot" location to the "/usr/lib/" folder.
The location of the library to be copied is:
>> fullfile(matlabroot, 'bin/maci64/libmwblas.dylib')
and it should be copied to
/usr/lib/
If you do not have access to that folder, you can place the library in a folder on the MATLAB path that you are working with, such as near the M file you are writing.