I resorted to using a 32gb ram cpu instead of the 8gb ram one i was using to load the file. Learn more about matlab compiler corrupt file matlab compiler. Error unable to read mat file.