Path: news.mathworks.com!not-for-mail
From: "us " <us@neurol.unizh.ch>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Best way to loop through unknown structure
Date: Wed, 15 Aug 2007 20:34:23 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 21
Message-ID: <f9vo0f$rs5$1@fred.mathworks.com>
References: <f9ufl4$tb$1@fred.mathworks.com>
Reply-To: "us " <us@neurol.unizh.ch>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1187210063 28549 172.30.248.38 (15 Aug 2007 20:34:23 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 15 Aug 2007 20:34:23 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:424055


Karl Trumstedt:
<SNIP wants to infest his/her clean workspace with numerous 
field data...

one of the (unconventional) solutions

% the data
     s.a=1:5;
     s.b=pi;
     s.c=magic(4);
% the engine
     fnam='foo.mat'; % <- use your own test file!
     save(fnam,'-struct','s');
% the result
     clear a b c s; % !
     load(fnam);
     a
     b
     c

us