The issue is in how you use YLABEL. Try:
set(ax1,'ylabel', 'Distance(m)');
The point is that you need a different type of handle here, not the axis handle. Insteadt run
set(ax1,'Ycolor','r','YLim',[0 500], 'FontSize',22, 'FontName','Helvetica');
set(get(gca,'YLabel'),'String','Distance (m)')
Best Answer