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:
In[4]:= N@Subdivide[-5, 5, 6]
Out[4]= {-5., -3.33333, -1.66667, 0., 1.66667, 3.33333, 5.}
Note that I am not a Matlab user and haven't actually used linspace
, this is just based on what I was able to infer from their documentation.