diff matlab/db/dbcellmap.m @ 36:a1094b51a6c4

Added missing matlab file.
author samer
date Thu, 06 Feb 2014 16:26:30 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/matlab/db/dbcellmap.m	Thu Feb 06 16:26:30 2014 +0000
@@ -0,0 +1,10 @@
+function Y=cellmap(fn,X)
+% cellmap - Map a function over a cell array
+%
+% cellmap :: (A->B, {[Size]->A}) -> {[Size]->B}
+
+% preallocate to fix size
+Y=cell(size(X));
+for i=1:numel(X)
+	Y{i}=feval(fn,X{i});
+end