AMD, you don't say what's in your array, so I'll have to guess that because you're looking for NaNs, all of the variables are double. But a dataset array is still a container, and so functions that you can apply to a double variable won't work on a dataset array, even if all of its variables are double. It is more general, and has to account for the fact that you could have mixed data types in it.
A couple things:
- That loop seems unnecessary, since sortrows is happy to sort on multiple variables in the dataset:
sorted = sortrows(rr2,1:738,'descend');
Perhaps you are trying to get all the rows with a NaN at the top. I don't think your loop does that though.
- To find rows with NaN, you can do this:
rowsWithNaN = any(isnan(double(rr2)),2); rr2 = rr2(~rowsWithNaN,:);
If you have access to the R2012b pre-release, you might look there for a slightly simpler way to do that.