I currently have a 4 * 5057 matrix in MATLAB called "cols". What I'm trying to do is find the k minimum values of the first row, and store them in a new matrix called "mins".
So, say k was 3, I'd like the function to scan the entire first row of "cols", pick out the smallest 3 values, and copy that entire column to the new matrix.
I understand how to do the end part, but it's just designating how to actually write the function that finds not just the single lowest number, but multiple that stumps me.
I've read through the MathsWorks page on the min function as well as a few others that came up on a search, but with no luck.
Any help would be greatly appreciated! Please and thank you!