??? Error using ==> mldivide Matrix dimensions must agree.
이전 댓글 표시
hy everyone can help me to fix my problem ??
Error in ==> masukan at 18 c = sqrt(sum(s.^2)/sum(b_in.^2));
function [y,b,b_in,s,Fs] = masukan (SNR)
%Masukan sinyal suara dan sinyal derau
[s,Fs] = wavread('suara.wav');
%n =length(s);
b_in = wavread('derau_angin.wav');
%Menghitung faktor normal SNR
c = sqrt(sum(s.^2)./sum(b_in.^2));
b = c * 10^(SNR./20) * b_in;
%Sinyal suara dan derau
y = s + b;
end
thanks for your help
댓글 수: 4
iqball
2018년 2월 4일
Star Strider
2018년 2월 4일
The error refers to:
c = sqrt(sum(s.^2)/sum(b_in.^2));
You vectorised it in the code you posted:
c = sqrt(sum(s.^2)./sum(b_in.^2));
so I assume matrix division is not the problem, and array sizes are. However, this would be rdivide or mrdivide, so I have no idea what the actual error is.
That aside, apparently, ‘suara.wav’ and ‘derau_angin.wav’ are different lengths (row sizes).
Only you can solve that problem.
iqball
2018년 2월 5일
Star Strider
2018년 2월 5일
My pleasure.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!