Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Save with -struct option
Date: Wed, 12 Mar 2008 12:29:02 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 17
Message-ID: <fr8iae$ksm$1@fred.mathworks.com>
References: <fr8hi2$b2m$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1205324942 21398 172.30.248.35 (12 Mar 2008 12:29:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 12 Mar 2008 12:29:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:456771



"Ben ":
<SNIP save/load a struct

one of the solutions

     s.a='a';
     s.b=pi;
     s.c=magic(3);
     fnam='foo.mat'; % <- use your file name!
     save(fnam,'s');
     clear s;
     whos('-file',fnam)
     load(fnam);
     disp(s)

us