필터 지우기
필터 지우기

Error checking in matlab

조회 수: 2 (최근 30일)
adnan abid
adnan abid 2020년 12월 31일
댓글: Walter Roberson 2020년 12월 31일
I am new to matlab. In other programming softwares when you get error they will tell you where the error is and what is the error so you can search it in internet. On the other hand in matlab i am using live script to write a program it does tell me which line has error but i could not find out what the error is so i can search about it. Is there any error window or way to check error discription. my code is given below it says line 11 has an error in command window
[file, path] = uigetfile('*.wav','Select a .wav file');
if file == 0
return
end
out_dir = uigetdir(cd,'Choose output folder');
if out_dir == 0
return;
end
[y,Fs,nbits]= audioread(file);
if size(y,2) == 1
msgbox('The selected file is Mono. This algorithm is applicable only for Stereo files.');
return;
end
fc=input('Enter Cutoff Frequency (HPF):');
fc=round(fc);
if fc > 20
fp = fc+5;
fs = fc/(Fs/2);
fp = fp/(Fs/2);
[n, wn] = buttord(fp,fs,0.5,80);
[b, a] = butter(5,wn,'High');
channel_2 = filtfilt(b,a,y(:,2));
else
channel_2 = y(:,2);
end
karaoke_wav = y(:,1) - channel_2;
%Write it to a file
[p, name, ext] = fileparts(file);
if isfolder(out_dir)
audiowrite(karaoke_wav,Fs,nbits,[out_dir '\' name ext]);
else
audiowrite(karaoke_wav,Fs,nbits,[cd '\' name ext]);
end
  댓글 수: 2
John D'Errico
John D'Errico 2020년 12월 31일
MATLAB does return error messages.
You tell us it does not say what the error is? When you get an error, the only way for us to know what it was is if you report the ENTIRE text of the error message, thus everything in red.
Walter Roberson
Walter Roberson 2020년 12월 31일
If you have the editor docked then the error message may have scrolled up past what is visible and you may need to scroll back.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by