Akzeptierte Antwort

Walter Roberson
Walter Roberson am 27 Nov. 2020

1 Stimme

data_gt(:,7) == 1
extracts column 7 from all rows of matrix data_gt . It then compares each of the values to the constant one, returning a logical vector with the same number of entries as there are rows in data_gt . Each entry will be logical value false or true
data_gt(data_gt(:,7) == 1, :)
takes that logical vector as input into a data_gt(INDEX, :) operation . Each entry in the vector that is true results in the corresponding entire row being selected for output, and each entry in the vector that is false results in the corresponding entire row not being selected for output. Therefore data_gt(data_gt(:,7) == 1, :) ends up outputing the rows of data_gt in which column 7 equals 1.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by