Matlab has a built in function called linspace, that, according to the documentation, generates a linearly spaced vector, but “gives direct control over the number of points and always includes the endpoints”.
Mathematica doesn’t work with vectors, rather with lists, but I wish to generate a list of numbers that start from x1 and ends at x2, with n points in between (such that the spacing between the points is (x2-x1)/(n-1).
I couldn’t find help with Table. Table generates a list of numbers with a starting point and an end point, with an extra option for the intervals, but I want to have n numbers in between.
I think what you want is Subdivide, which I believe is similar to linspace, however instead of n evenly spaced points, Subdivide generates the list of valued from subdividing the range into n equal parts. So linspace(-5,5,7) from Matlab would be equivalently N@Subdivide[-5, 5, 6] in Mathematica: