You can use the isnan function to find the indices of columns that have at least one NaN, and then use the (:, all(...)) syntax to drop those columns:
main.m217 chars9 lines
This creates a new matrix data_no_nan that has the same number of rows as data, but without any columns that contain a NaN value.
gistlibby LogSnag