MATLAB Answers

how to solve this error "Subscripted assignment dimension mismatch."

1 view (last 30 days)
Yussif M. Awelisah
Yussif M. Awelisah on 12 Oct 2019
Commented: Guillaume on 15 Oct 2019
I tried looping through 231 samples of data but the error below occurs,
Subscripted assignment dimension mismatch.
Error in tvf_emd (line 132)
imf(nimf,:)=y(ind_remov_pad);
if flag_stopiter
for row_number = 1 : size(imf,1);
end
imf(nimf,:)=y(ind_remov_pad);
temp_x=temp_x - y(ind_remov_pad);
break;
each Imf is supposed to be 50x 500 but due to the 231 data samples , the imf matrix multiplies to become 50 x 115500.
This causes the above error even though I tried looping through each sample.
Please I will be grateful for any help.
  9 Comments
Guillaume
Guillaume on 15 Oct 2019
tvf_emd is a function, therefore you must be calling it from some other code (the same code that actually imports your data), maybe it's a script. The loop is in that other code. The function itself should be unmodified, e.g.
%script or function, NOT tvf_emd.m
matcontent = load('Total matrix data..mat')
DS_DATA_ODD = matcontent.DS_DATA_ODD;
out = zeros(50, size(DS_DATA_ODD, 2), size(DS_DATA_ODD, 1))
for row = 1:size(DS_DATA_ODD, 1)
out(:, :, row) = tvf_emd(DS_DATA_ODD(row, :));
end

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!