The file name has to be a string:
audiowrite('anna_ten10.wav', trimmed_anna_ten10, 44100)
I am assuming here you want to save it as a ‘.wav’ file. Change that if you want to save it in another format.
audiowrite( writes a matrix of audio data, filename,y,Fs)y, with sample rate Fs to a file called filename. The filename input also specifies the output file format. The output data type depends on the output file format and the data type of the audio data, y.
For example
filename = 'handel.wav'; audiowrite(filename,y,Fs); clear y Fs
Read the data back into MATLAB using audioread.
[y,Fs] = audioread(filename);
Listen to the audio.
sound(y,Fs);
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Explore similar technical troubleshooting questions and verified MATLAB solutions: