Need help troubleshooting MatLab error
Mostra commenti meno recenti
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
Risposte (1)
Image Analyst
il 29 Mag 2018
0 voti
y is 73113 elements long while x2 is 10000 elements long. How/why do you expect that to work???
3 Commenti
Austin Gaylor
il 30 Mag 2018
Image Analyst
il 30 Mag 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
il 30 Mag 2018
Categorie
Scopri di più su Transforms in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!