what is wrong in this code?
이전 댓글 표시
load('matlab.mat', 'voltage');
level = 6;
wavelets = {'haar','db1', 'db2', 'db3', 'db4', 'db5', 'db6', 'db7', 'db8', 'db9', 'db10','sym2', 'sym3', 'sym4', 'sym5', 'sym6', 'sym7', 'sym8', 'sym9',
'sym10','coif1', 'coif2', 'coif3', 'coif4', 'coif5', 'bior1.1', 'bior1.3', 'bior1.5', 'bior2.2', 'bior2.4', 'bior2.6', 'bior2.8', 'bior3.1', 'bior3.3', 'bior3.5',
'bior3.7', 'bior3.9', 'bior4.4', 'bior5.5', 'bior6.8','rbior1.1', 'rbior1.3', 'rbior1.5', 'rbior2.2', 'rbior2.4', 'rbior2.6', 'rbior2.8', 'rbior3.1', 'rbior3.3', 'rbior3.5', 'rbior3.7', 'rbior3.9', 'rbior4.4', 'rbior5.5', 'rbior6.8', 'dmey', 'fk4', 'fk6', 'fk8', 'fk14', 'fk18', 'fk22'};
SD = zeros(1, length(wavelets)); % preallocate SD vector with zeros
for i = 1:length(wavelets)
% Perform wavelet decomposition
[c,l] = wavedec(voltage, level, wavelets{i});
% Extract detail coefficients from level 6
details = detcoef(c,l,6);
% Calculate standard deviation of detail coefficients
SD(i) = std(details);
end
% Display the results
disp(SD)
Error
Dimensions of matrices being concatenated are not consistent.
Dimensions of matrices being concatenated are not consistent.
댓글 수: 3
Jan
2023년 3월 12일
Please post a copy of the complete error message. Then the readers do not have to guess, where the problem occurs.
Muhammad Tarique
2023년 3월 12일
Star Strider
2023년 3월 12일
I do not see that you are concatenating any matrices in the posted code.
The error (in most instances) will also display the line of code throwing the error, or at least refer to it. Please show that line of code as well.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!