view general/arrutils/pad.m @ 6:0ce3c2070089

Removed duplicate code and fixed doc in timed_action.
author samer
date Mon, 14 Jan 2013 14:33:37 +0000
parents e44f49929e56
children
line wrap: on
line source
function b=pad(x,sz,a), 
% pad - pad out an array to given size with given elements
%
% pad :: A, D:[[2]], [[S]->A] -> [D->A].

[N,M]=size(a);
b=repmat_to(x,max(sz,[N,M]));
b(1:N,1:M)=a;