TEMPLATE/SUBST Substitute a replacement field by its value STR = SUBST(TPL,HANDLE) substitute all the known fields of variable HANDLE in the template TPL.
0001 function [tpl, str] = subst(tpl,handle) 0002 %TEMPLATE/SUBST Substitute a replacement field by its value 0003 % STR = SUBST(TPL,HANDLE) substitute all the known fields of variable HANDLE 0004 % in the template TPL. 0005 0006 % Copyright (C) 2003 Guillaume Flandin <Guillaume@artefact.tk> 0007 % $Revision: 1.0 $Date: 2003/05/05 22:19:51 $ 0008 0009 tpl = loadtpl(tpl,handle); 0010 0011 str = get(tpl,'var',handle); 0012 for i=1:length(tpl.varkeys) 0013 str = strrep(str, strcat('{',tpl.varkeys{i},'}'), tpl.varvals{i}); 0014 end