function a = fare(dist,age) ... fare=2; ...
Unlike Fortran, the return value in a Matlab function is not stored in the function as a variable of the function name but one uses the defined return variable instead. You defined that as a in the function declaration.
I'd pick something a little more meaningful than just a, though, although that's not your problem.
etc., will fix that reference issue. Maybe use
function cost = fare(dist,age)
or somesuch similar variable???
Is the distance actually rounded in the fare calculation or is it for any fraction of a mile over the previous full mile? The latter would seem more typical if not going to use actual mileage to nearest tenth or whatever...