tergen1d(level)

1D random terrain generator
64 Downloads
Updated 24 Jul 2015

View License

tergen1d(level) is a random terrain generator in 1 dimension. It begins by dividing a line segement between (0,0) and (1,0). Next, it adds a random value between (-1,1) to the y-value of the dividing point at x=0.5. The two new line segments are then split in the same way but the range of the new y-value addition is decreased by half (-0.5,0.5). This is repeated level times.

Cite As

Andrew Wheatley (2024). tergen1d(level) (https://www.mathworks.com/matlabcentral/fileexchange/52263-tergen1d-level), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux

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