MATLAB: Deleting rows containing NaN nan I have 2 columns and 1000+ rows matrix. I want to delete the rows in which either column 1 or 2 is NaN thank you Best Answer Array(any(isnan(Array),2),:) = []; Related SolutionsMATLAB: How to eliminate rows with NaN elements rows = any(isnan(myMatrix),2);myMatrix(rows,:) = []; MATLAB: Delete rows with NaN records X = rand(10, 10);X(X < 0.1) = NaN;disp(X);X(any(isnan(X), 2), :) = [];Or do you mean exactly one NaN in a row?X(sum(isnan(X), 2) == 1, :) = []; Related QuestionI want to delete a specific number of NaN in a matrixHow to delete entire row containing a certain value.Correlation between two row matricesDelete NaN rows and columns butConstructing an if statement when a column contains only one data point and the rest are NaNsIgnoring [NaN; NaN]
Best Answer