Removing rows from all columns based on values of one column

조회 수: 38 (최근 30일)
crixus
crixus 2015년 2월 20일
편집: crixus 2015년 2월 21일
Hi all, i have a data of 732x26 and one of the column contains unwanted values, i used
logicalIndex = FOMassFlow > MeanFOMassFlow;
FOMassFlow = FOMassFlow(FOMassFlow ~= 0)
to remove the unwanted values of the particular column. How can i remove the rows of the unwanted values in the data of 732x26 ? (example, unwanted values found in column 5 row 6, i would like to remove the entire row 6 in the data of 732 rows by 26 columns)

채택된 답변

Jos (10584)
Jos (10584) 2015년 2월 20일
Here is an example
X = randi([1 10],10,3) % example data
TF = X(:,3) > 5 % for which rows is column 3 larger than 5
X(TF,:) = [] % remove those rows
  댓글 수: 1
crixus
crixus 2015년 2월 21일
편집: crixus 2015년 2월 21일
THANKS FOR YOUR SOLUTION. IT WORKS !

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Shrirang
Shrirang 2015년 2월 20일
Hi Crixus, Suppose name of your data matrix is X which is of size 732*26 and you want to remove row 6 then you can use following syntax X(6,:) = [] this will delete your 6th row in X matrix. I hope this will help you.
  댓글 수: 1
crixus
crixus 2015년 2월 20일
편집: crixus 2015년 2월 20일
Thanks for your answer, the code would remove the 6th row but does it remove the 6th row based on the unwanted values of say, column 5 row 6 ? The code you provided is more of specifying which row you wanna delete right ?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by