Need help troubleshooting MatLab error
Mostrar comentarios más antiguos
I need help troubleshooting this error message,
Matrix dimensions must agree.
Error in myExperimentThreeLab6 (line 38) Error1 = y ./ x2;
function myExperimentThreeLab6(~)
load handel.mat y;
%sound(y,8192);
% Experiment Three
subplot(4,1,1);
stem(y(100:18000));
title('Original Signal');
% A)
x1 = fft(y,10000);
x2 = ifft(x1,10000);
subplot(4,1,2);
stem(x2);
title('Signal at 10,000');
% B)
x3 = fft(y,16000);
x4 = ifft(x3,16000);
subplot(4,1,3);
stem(x4);
title('Signal at 16,000');
% C)
x5 = fft(y,17901);
x6 = ifft(x5,17901);
subplot(4,1,4);
stem(x6);
title('Signal aat 17,901');
% Experiment Four
Error1 = y ./ x2;
Error2 = y ./ x4;
Error3 = y ./ x6;
fprintf('Errror at 10,000 = %f \n ', Error1);
fprintf('Errror at 16000 = %f \n ', Error2);
fprintf('Errror at 10,000 = %f \n ', Error3);
end
Respuestas (1)
Image Analyst
el 29 de Mayo de 2018
0 votos
y is 73113 elements long while x2 is 10000 elements long. How/why do you expect that to work???
3 comentarios
Austin Gaylor
el 30 de Mayo de 2018
Image Analyst
el 30 de Mayo de 2018
You could use interp1(), but you really need to understand what you want to do, because that's not really the right thing to do. It's just a bandaid patch to the problem that doesn't fix the real problem
Austin Gaylor
el 30 de Mayo de 2018
Categorías
Más información sobre Transforms en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!