What error do you encounter, or what difference do you see between the output and your expected output ?
Is omega for the solution expected to be negative? If that sum() is expected to be 0 then you have to have some negative terms, and those can arise either by omega being negative or by Rs(i,T) - Rf being negative.
Why do you compute Rs(:,1:55) but use only Rs(i,55) and none of the other Rs(:,1:54) ? Why not just skip calculating the other Rs if you are going to only use the last of them? And what is going to happen on the day that you set N different than T ?