M-File Help: ktriangle View code for ktriangle

ktriangle

Triangular kernel

k = ktriangle(w) is a triangular kernel within a rectangular matrix k. The dimensions k are WxW if w is scalar or w(1) wide and w(2) high. The triangle is isocles and is full width at the bottom row of the kernel and with its apex in the top row.

Examples

>> ktriangle(3)
ans =
|0  1  0|
|0  1  0|
|1  1  1|

See also

kcircle


 

© 1990-2012 Peter Corke.