linspace_round

Creates linearly spaced vector with "rounded" intervals.
730 Downloads
Updated 25 Jun 2007

No License

LINSPACE_ROUND generates a row vector of equally spaced points that bound the input values. The spacing is chosen such that tenths and quarters are considered "rounded" fractions.

Example: If X1 = 3.4, X2 = 7.5, N = 6,
then LINSPACE_ROUND(X1,X2,N) returns:
[2.8 3.5 4.2 4.9 5.6 6.3 7.0 7.7]
(in words, choosing spacing of 0.7 will produce about 6 points that bound X1 and X2)

This is useful in having automatically chosen data bins, contour intervals, graph tick marks, etc., that are pleasing to the eye.

Cite As

Andy Eichelberger (2024). linspace_round (https://www.mathworks.com/matlabcentral/fileexchange/15409-linspace_round), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R13SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Creating and Concatenating Matrices in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0