Filter löschen
Filter löschen

delete rows based on whether the value in column 10 of the respective row is equal to one or not

2 Ansichten (letzte 30 Tage)
Hi,
I tried to solve the problem described above with the following formula:
dataset=[dataset,delete];
rowsToDelete8 = dataset(:,10)==1;
dataX(rowsToDelete8, :) = [];
where dataset is double and the 10th column is either 1 or 0
While doing this, I get the following error message:
Index of element to remove exceeds matrix dimensions.
Error in deleteSeriesWithOnlyFourElements (line 67)
dataX(rowsToDelete8, :) = [];
I do not really understand why it's not working

Akzeptierte Antwort

Image Analyst
Image Analyst am 24 Apr. 2013
rowsToDelete8 was based on looking at dataset, not dataX, but then you try to use it in dataX, which is evidently not the same size as dataset.
Also, don't use "delete" as the name of a variable like you did in "dataset=[dataset,delete];"

Weitere Antworten (0)

Kategorien

Mehr zu Random Number Generation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by