I want to create an array of numbers between 0 and 0.1 where the points are clustered around an arbitrary point x1 (0 < x1 < 0.1). I want the points to get exponentially closer together near x1 from either side and and get further apart towards the outer limits. I am using MatLab and was trying to use tanh and linspace.(adsbygoogle = window.adsbygoogle || []).push({});

tanh(linspace(0,6,50)) gives a suitable shape for 0 to x1 and -tanh(linspace(1,6,50)) for x1 to x2.

However I can't make it work for my limits, taking into account that x1 varies.

(I will later need to take a weighted mean of these points but that's another problem..)

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MatLab: array of numbers unequal distribution

**Physics Forums | Science Articles, Homework Help, Discussion**