You want to create a vector x, that contains exactly L points, with a uniform spacing of d, and that starts at 0. Trivial. Yes, you could use linspace. But for that to work, you need to figure out what the end point should be. Even if you use colon, it may seem like you need to know the end point. But you don't!
That is, if you want a vector of exactly L points, then start by using colon to create a vector of integers, from 0 to L-1. Then just multiply the entire vector by d. Trivial.
So EXACTLY 5 points, with a spacing of 0.25. Made simply. I never need to know what the last point will be to use linspace, because for this purpose, linspace is the wrong tool to use. You wanted to generate L points equally spaced. So the correct tool to use is colon.
Suppose you wanted some other start point than zero? Again, still trivial.
4 points, starting at 12, with a spacing of 0.5.
If this is something you will do often, then just create a function that does it for you. For example, as a function handle, I would do this:
vecmaker = @(x0,L,d) x0 + (0:L-1)*d;
But you could also write it as an m-file, if this is something you do frequently. Personally, I see no real purpose, because it is so easy to perform the task using colon. But feel free. Were I to do this, I would probably write it like this (and hopefully, I would choose a more creative name):
function x = vecmaker(L,d,x0)
if (nargin < 3) || isempty(x0)
As you can see, I wrote this to allow you to not provide the start point, if that would commonly be 0 by default.
The virtue of a language like MATLAB, is when you see something that you wish to do often, the language is so easily extensible. If there is capability you find missing, then write it yourself. Create your own toolbox of tools that you will use. Put them in a separate directory on your search path, so now you can use these tools for any work you do.