]> Creatis software - CreaPhase.git/blob - octave_packages/struct-1.0.10/tars.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / struct-1.0.10 / tars.m
1 ## Copyright (C) 2000 Etienne Grossmann <etienne@egdn.net>
2 ## Copyright (C) 2012 Olaf Till <i7tiol@t-online.de>
3 ##
4 ## This program is free software; you can redistribute it and/or modify it under
5 ## the terms of the GNU General Public License as published by the Free Software
6 ## Foundation; either version 3 of the License, or (at your option) any later
7 ## version.
8 ##
9 ## This program is distributed in the hope that it will be useful, but WITHOUT
10 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12 ## details.
13 ##
14 ## You should have received a copy of the GNU General Public License along with
15 ## this program; if not, see <http://www.gnu.org/licenses/>.
16
17 ## s = tars (foo,bar, ... ) == struct ("foo",foo,"bar",bar,...)
18 ##
19 ## Groups foo, bar, ... into a struct whose fields are "foo", "bar" ...
20 ## and such that s.foo == foo, s.bar == bar ...  
21 ##
22 ## See also : untar
23
24 function s = tars (varargin)
25
26   s = cell2struct (varargin, deblank (cellstr (argn)), 2);
27
28 endfunction