MATLAB: Can’t sort this code

MATLABpdf

The original question has been removed by the user.

Best Answer

You define fnj as MxN, but in your for loop you are assigning values to fnj(j,n) where:
j = 1 : N
and
n = 1 : M
I think you meant to do "j = 1 : M" and "n = 1 : N"
Also make the change suggested by proecsm, namely
Fn = sum(fnj,2)
Related Question