MATLAB: 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 deletionnanrow 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)) = []; Best Answer a = 1:10;b = 1:10;b(1) = NaN;b(end) = NaN;NaN_Vals = find(isnan(b));a(NaN_Vals) = [];b(NaN_Vals) = []; Related SolutionsMATLAB: Count number of values between NaN In = [NaN; NaN; NaN; NaN; 1; 1; 1; 1; NaN; NaN; NaN; 1; NaN; NaN; NaN; NaN; NaN; NaN; NaN; 1; NaN; NaN; NaN; NaN];[a,b] = rude(~isnan(In));a(b)rude is on the FEX MATLAB: Correlation between two row matrices Like that, each value of "a" is correlated to each value of "b", but applying the formula of the correlation, the correlation of two single numbers is NaN. To compute the correlation correctly, traspose the input vectorsresult = corr(a', b'); Related QuestionHow to select or group sections of an array without using indexingSame matrix but not equal problemReplace numbers in a matrix depending on neighbor numbersConstructing an if statement when a column contains only one data point and the rest are NaNsFinding values of specific range from table row or column
Best Answer