MATLAB: How to find corresponding row positions of specific values in a matrix

row positions

Hi,
I have matrix A (365×42) with mean daily temperature for 42 years and matrix B (1×42) with lowest daily temperature in each year derived from matrix A using B = min(A).
I want another matrix C (1×42) with corresponding row positions (in each column of matrix A) of values in matrix B.
Thank you!

Best Answer

The function min will do this for you
[B,C] = min(A,[],1);