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

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 Commenti

Please provide the subset details. Also why you are using repelem={}; Please note repelem is a MATLAB inbuilt function.
Yes..the problem could be due that line....
repelem = {} ;
Remove that line.
this line is defining repelem so it has to be there its what im getting from other sources if i remove it them this error comes in; "undefined function repelem"
repelem is a inbuilt function.....you are not supposed to use like that. What version you are using?

Risposte (1)

KSSV
KSSV il 16 Giu 2020
Modificato: KSSV il 16 Giu 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 Commenti

Thanks but the same error is showing up
What data you have actually? Attach your data.
Kindly see attached code and the data set pics for one class that is sign zero

Questa domanda è chiusa.

Richiesto:

il 16 Giu 2020

Chiuso:

il 20 Ago 2021

Community Treasure Hunt

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

Start Hunting!

Translated by