https://www.mathworks.com/matlabcentral/answers/666993-matlab-code-for-writing-an-mp3-file-in-versions-after-2015#comment_1167878
audiowrite used to handle mp3 but it was removed in r2015b: at the time there was an active patent dispute and companies were demanding to be paid. My notes say that the patents have expired now.