Subscripted assignment dimension mismatch.

Please I am grateful for your concern. My code use to have a horzcat dimensions but I received great support from here which helped a lot. The below problem still exist. This occurs because one sample of my data is 1 x 500 and Im running the code on 231 samples of data with matrix 231 x 500.
The imf of each samples is 50 x 500 but the data of the 231 samples turns to multiply the number of samples(231) by 500 which results in 50 x 115500 instead of looping through the imf of the 231 individually.
at this point I need a way to loop through for the imf to be 50 x 500 and not 50 x 1155500 or a way to solve the mismatch of dimension.
error:
Subscripted assignment dimension mismatch.
Error in tvf_emd (line 127)
imf(nimf,:)=y(ind_remov_pad);
the code and data is attached.

6 件のコメント

Walter Roberson
Walter Roberson 2019 年 9 月 25 日
Unrecognized function or variable 'INST_FREQ_local'.
61 [instAmp0,instFreq0] = INST_FREQ_local(y);
Yussif M. Awelisah
Yussif M. Awelisah 2019 年 10 月 9 日
@stephen Cobeldick.
This a known person I have contact with.
The code of splinefit has been removed.
Thanks for the notice.
Stephen23
Stephen23 2019 年 10 月 9 日
"This occurs because one sample of my data is 1 x 500 and Im running the code on 231 samples of data with matrix 231 x 500. "
It is not completely clear what the problem is: surely you can easily loop over the rows and easily collect the outputs into a cell array. After the loop you can concatenate them, padding as required.
Yussif M. Awelisah
Yussif M. Awelisah 2019 年 10 月 9 日
I appreciate your help and concern @Stephen Cobeldick
I tried the loop as below
for row_number = 1 : size(temp_x,1)
y = temp_x(row_number, :);
y = [fliplr(y(2:2+num_padding-1)) y fliplr(y(end-num_padding:end-1))]; % padding to deal with boundary effect (symmetric)
end
but the below error occurs.
Index exceeds matrix dimensions.
Error in tvf_emd (line 50)
y = [fliplr(y(2:2+num_padding-1)) y fliplr(y(end-num_padding:end-1))]; % padding to deal with boundary effect (symmetric)
I wil be grateful if you can provide any other help.
Yussif M. Awelisah
Yussif M. Awelisah 2019 年 10 月 12 日
@Walter Robertson
@Stephen Cobeldick
At this moment, I think the best way is to use the preallocation since the value of y increases within the loop but I dont know the best preallocating method in this case.
I tried using 'zeros' this did not work.
I would be grateful for your help

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

質問済み:

2019 年 9 月 25 日

コメント済み:

2019 年 10 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by