Mercurial > hg > ishara
view general/fileutils/loadmat.m @ 7:47cb292350f3
Some documentation fixes.
author | samer |
---|---|
date | Mon, 14 Jan 2013 14:52:38 +0000 |
parents | e44f49929e56 |
children | 9e7be347b3a0 |
line wrap: on
line source
function varargout=loadmat(file,varargin) % loadmat - hygienic loading from mat files % % The point of this function is to load certain named variables % from a Mat file without polluting the current environment with % other objects from the Mat file or having name clashes. % % loadmat :: text ~'filename', text~'variable name' -> object~'something'. % loadmat :: % text ~'filename', % {[N]->text} ~'list of variable names' % -> {[N]->object} ~'list of things'. % % Vararg form (not well typed) % % [X,Y,Z,...]=loadmat(Filename,var1,var2,var,...); load(file); for j=1:length(varargin) var=varargin{j}; if iscell(var), X__=cell(1,length(var)); for k=1:length(var) eval(sprintf('X__{%d}=%s;',k,var{k})); end varargout{j}=X__; else eval(['varargout{j}=' var ';']); end end