From: Josep i T. <jm...@pu...> - 2004-08-08 18:50:15
|
Let's introduce padarray... -- Function File: B = padarray (A,PADSIZE) -- Function File: B = padarray (A,PADSIZE,PADVAL) -- Function File: B = padarray (A,PADSIZE,PADVAL,DIRECTION) Pads an array in a configurable way. B = padarray(A,padsize) pads an array A with zeros, where PADSIZE defines the amount of padding to add in each dimension (it must be a vector of positive integers). Each component of PADSIZE defines the number of elements of padding that will be added in the corresponding dimension. For instance, [4,5] adds 4 elements of padding in first dimension (vertical) and 5 in second dimension (horizontal). B = padarray(A,padsize,padval) pads A using the value specified by PADVAL. PADVAL can be a scalar or a string. Possible values are: `0' Pads with 0 as described above. This is the default behaviour. `scalar' Pads using PADVAL as a padding value. `'circular'' Pads with a circular repetition of elements in A (similar to tiling A). `'replicate'' Pads 'replicating' values of A which are at the border of the array. `'symmetric'' Pads with a mirror reflection of A. B = padarray(A,padsize,padval,direction) pads A defining the direction of the pad. Possible values are: `'both'' For each dimension it pads before the first element the number of elements defined by PADSIZE and the same number again after the last element. This is the default value. `'pre'' For each dimension it pads before the first element the number of elements defined by PADSIZE. `'post'' For each dimension it pads after the last element the number of elements defined by PADSIZE. -- Josep Monés i Teixidor Clau GnuPG: gpg --recv-keys 80E85CC4 |