Why does inequality give different values even though its evaluating the exact same matrix ??
2 views (last 30 days)
Walter Roberson on 11 Dec 2021
sort(td(td(:,5) < 11.29))
td is a 2D array with multiple columns. You construct a mask from one of the columns, and you use it to index the entire td array -- which by linear indexing is going to effectively have it operate on the first column.
t = (td(:,5));
sort(t(t < 11.29))
but here you extract the column and your linear indexing is against the extracted version that only contains the one column.