How can I save a recorded audio as .mp3 using matlab and load it then play it?

How can I save a recorded audio as .mp3 using matlab and load it then play it.
here is my code so far:
recObj = audiorecorder(8000,8,1);
disp('Start speaking.');
recordblocking(recObj, 5);
disp('End of Recording.');
y = getaudiodata(recObj);
plot(y);

Tags

Asked:

on 23 Apr 2018

Answered:

on 23 Apr 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!