I would STRONGLY recommend you learn to use descriptive variable names. a? b? z?
MATLAB does not charge more for you to use two or, god forbid, even three letter names. Even more are possible, or so I hear. But the use of descriptive variable names will make your code possible to debug, when your code becomes longer and far more complex.
I have no idea why you selected points as you did, as there are far easier ways to generate points randomly from an interval. (Read the help for rand.) But consider what this would do:
But now, you want to generate WHAT perpendicular? Perpendicular lines to the curve? Or do you want to drop line segments from those points that are perpendicular to the x axis? Both are pretty easy, but the latter is trivial.