How to record audio signal in MATLAB?
Use an audiorecorder object to record audio data from an input device such as a microphone for processing in MATLAB®. The audiorecorder object contains properties that enable additional flexibility during recording. For example, you can pause, resume, or define callbacks using the audiorecorder object functions.