What is the simplest way to generate piecewise level function like the following
Suppose, I know height (y-value) and length (horizontal) of each level in a matrix
>> C=[2,4,1,-3;2,1.5,0.7,2.8]
C =
2.0000 4.0000 1.0000 -3.0000
2.0000 1.5000 0.7000 2.8000
I.e. first row says level level, and the second -- it's horizontal length.
Also I would like to have some interpolation between levels.