I am fairly new to matlab
I wanted to convert a comma separated value (.csv) file to a Wave (.wav) audio file while also plotting it.
I saw this previously answered Here on matlab answers but I had a few questions and some errors, for the sake of simplicity I have attached the code and the csv file here
error shown is
Undefined function or variable 'y'.
Error in Untitled (line 17)
audiowrite('audio_output.wav',y,Fs)
and I did not understand why in the code the variable 'y' and 'Fs' are there in code
clc;clear all;close all;data=csvread("output.csv");time=data(: ,1);output=data(: ,2);plot(time,output);save('aec.mat','time','output');load aec.matfilename='audio_output.wav';Fs=6000;audiowrite('audio_output.wav',y,Fs)clear y Fs[y,Fs]=audioread(filename);sound(y,Fs);
Best Answer