MATLAB: To convert m by n matrix to 1 by n

digital image processingimageimage processing

I want to convert 127 by 4 matrix to 1 by 4 matrix such that each value in the output row equivalent to average of all values in that particular column.

Best Answer

If the 127x4 matrix is named A, then use
mean(A)
If you want to be more precise about which dimension it calculates the mean over, use mean 's second argument as well:
mean(A,1)