Watch this Author's files
Little bug here (otherwise great, thanks):
>> nanmedian([0 0 0 0 0 1]) ans = NaN
Just modify line 71: i = find(y==0); to i = find(s==0);
Contact us at files@mathworks.com