??? Error using ==> mldivide Matrix dimensions must agree.
Mostrar comentarios más antiguos
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 comentarios
iqball
el 4 de Feb. de 2018
Star Strider
el 4 de Feb. de 2018
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
el 5 de Feb. de 2018
Star Strider
el 5 de Feb. de 2018
My pleasure.
Respuestas (0)
Categorías
Más información sobre Graph and Network Algorithms en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!