Updated 10 Dec 2003
This is a VERY simple, but very useful few-line program that calculates the starting points and size of uniformly spaced (GUI) objects. Use this function, or write your own--but you should have a distribute function if you manually create GUIs (without the development environment, which has a distribute function).
[OBJPOS,OBJDIM] = DISTRIBUTE(NOBJECTS,STARTPOS,ENDPOS,GAP)
(Enter the number of objects, starting and end points, and gap size, and position your objects horizontally or vertically at objpos(1), objpos(2),..., and with a width/height of objdim.)
Brett Shoelson (2023). distribute (https://www.mathworks.com/matlabcentral/fileexchange/4235-distribute), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
- AI, Data Science, and Statistics > Statistics and Machine Learning Toolbox > Probability Distributions > Continuous Distributions > Uniform Distribution (Continuous) >
Inspired: SegmentTool: An Interactive GUI for Segmenting Images
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.