tergen1d(level)

1D random terrain generator
65 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 (2026). 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
Version Published Release Notes
1.0.0.0