There are a few reasons why "Error 5" may occur:
This error can occur when attempting to install MATLAB 64-bit on a 32-bit operating system.
MATLAB 64-bit cannot be installed on Windows 32-bit, even if your processor is 64-bit.
SOLUTION: Install MATLAB 32-bit (R2015b or earlier). ARM 64 bit processors are currently not supported.
Corrupt Download / Antivirus Software
This error can occur if the installation files are corrupt.
Antivirus software will sometimes scan and corrupt downloaded files.
SOLUTION: Temporarily disable any antivirus software and download a new copy of the installer.
This error can occur if the self-extractor file does not have sufficient permissions to run.
SOLUTION: Navigate to the folder self-extractor file and right-click on the file and select "Run as administrator". If you do not have administrator privileges, please contact your IT department for further information on obtaining these privileges and installing software.