To find the rows of data that have the same minimum and maximum values, and remove the rows.

6 vues (au cours des 30 derniers jours)
NN
NN le 12 Déc 2020
Commenté : Sindar le 15 Déc 2020
I need to remove the rows that have same minimum and maximum values , below is the code used .
but it gives error:
Unable to perform assignment because brace indexing is not supported for variables of this type.
Kindly help
m = min([XTrain{:}],[],2);
M = max([XTrain{:}],[],2);
idxConstant = M == m;
for i = 1:numel(XTrain)
XTrain{i}(idxConstant,:) = [];
end
  10 commentaires
NN
NN le 12 Déc 2020
Modifié(e) : NN le 12 Déc 2020
Still brace indexing error is getting for the for loop
Unable to perform assignment because brace indexing is not supported for variables of this type.
m = min(XTrain,[],2);
M=max(XTrain,[],2);
idxConstant = M == m;
for i = 1:numel(XTrain)
XTrain{i}(idxConstant,:) = [];
end
Sindar
Sindar le 15 Déc 2020
if XTrain is an array, then
XTrain{i}
is both meaningless and causing the error. Use
XTrain(idxConstant,:) = [];

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by