Info

This question is closed. Reopen it to edit or answer.

Hie, how can i solve this error, "Index exceeds matrix dimensions"

1 view (last 30 days)
The code is as below;
repelem = {};
for ii = 1:numel(subset)
subsetLabels(ii) = repelem((subset(ii).Description),subset(ii).Count,1);
end
Then the error is;
Index exceeds matrix dimensions.
Error in SignLive (line 19)
subsetLabels(ii) = repelem((subset(ii).Description),subset(ii).Count,1);
THANK YOU IN ADVANCE FOR YOUR UNWAVERING SUPPORT AND HELP.
  5 Comments
KSSV
KSSV on 16 Jun 2020
repelem is a inbuilt function.....you are not supposed to use like that. What version you are using?

Answers (1)

KSSV
KSSV on 16 Jun 2020
Edited: KSSV on 16 Jun 2020
Try:
N = numel(subset) ;
subsetLabels = cell(N,1);
for ii = 1:N
subsetLabels{ii} = repelem((subset(ii).Description),subset(ii).Count,1);
end
  3 Comments
Talent Mukaro
Talent Mukaro on 16 Jun 2020
Kindly see attached code and the data set pics for one class that is sign zero

This question is closed.

Community Treasure Hunt

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

Start Hunting!