MATLAB: Take minimum and maximum of columns for a 1×31 cell

cell arraysmin/max

I have a cell array psdMonth that is 1×31, with each cell a 1×114 int 32. I would like to take the minimum of all of the columns of each cell to get a composite minimum that would be 1×114 int 32. So I would want the minimum of psdMonth{1}(1)……psdMonth{31}(1), and then the minimum of psdMonth{1}(2)….pdMonth{31}(2), etc.
I had tried something like this:
minpsdMonth = min(cat(1,psdMonth{:}))
which does create a 1×114 int32, but I'm not sure how to test if it's actually doing what I think it should. Can anyone tell me how I would get the output I want? Or verify that what I am doing is correct?
Thanks!

Best Answer

Two comments
  • your solution looks ok to me
  • test with some synthetic data, the results of which you know