Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

1 vue (au cours des 30 derniers jours)
Talent Mukaro
Talent Mukaro le 16 Juin 2020
Clôturé : MATLAB Answer Bot le 20 Août 2021
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 commentaires
KSSV
KSSV le 16 Juin 2020
repelem is a inbuilt function.....you are not supposed to use like that. What version you are using?
Talent Mukaro
Talent Mukaro le 16 Juin 2020
Matlab 2014b

Réponses (1)

KSSV
KSSV le 16 Juin 2020
Modifié(e) : KSSV le 16 Juin 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 commentaires
KSSV
KSSV le 16 Juin 2020
What data you have actually? Attach your data.
Talent Mukaro
Talent Mukaro le 16 Juin 2020
Kindly see attached code and the data set pics for one class that is sign zero

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by