??? 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 で Audio and Video Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!