MATLAB Answers

have two columns that are the same size but one of them has NAN on the first and last row, how would i delete those rows for both columns

1 view (last 30 days)
Ahmed Issa
Ahmed Issa on 2 Mar 2020
Commented: Ruger28 on 4 Mar 2020
code is this:
[rows, cols] = find(isnan(Fe));
Fe(:,unique(rows)) = [];
WAT(:,unique(rows)) = [];
error message is:
Matrix index is out of range for deletion.
Error in Comparison (line 204)
Fe(:,unique(rows)) = [];

  0 Comments

Sign in to comment.

Accepted Answer

Ruger28
Ruger28 on 2 Mar 2020
a = 1:10;
b = 1:10;
b(1) = NaN;
b(end) = NaN;
NaN_Vals = find(isnan(b));
a(NaN_Vals) = [];
b(NaN_Vals) = [];

More Answers (0)