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 - The Fusion of Science and Community**

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

# MatLab: array of numbers unequal distribution

Loading...

Similar Threads - MatLab array numbers | Date |
---|---|

Matlab Append new columns into Excel | Jun 20, 2016 |

Matlab Replace NaN with next element in Multidimensional Array | Apr 6, 2016 |

Structure Arrays (matlab) | Jul 30, 2014 |

Matlab : Function handle givin array to cell array of function handles | Mar 5, 2014 |

Matlab arrays with numbers and characters | Nov 10, 2009 |

**Physics Forums - The Fusion of Science and Community**