Path: news.mathworks.com!not-for-mail
From: "Ben " <basburywvu.nospam@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Save with -struct option
Date: Fri, 14 Mar 2008 13:51:02 +0000 (UTC)
Organization: Orbital Sciences Corp
Lines: 27
Message-ID: <frdvs6$lip$1@fred.mathworks.com>
References: <fr8hi2$b2m$1@fred.mathworks.com> <fr8iae$ksm$1@fred.mathworks.com> <fr8jt2$e3r$1@fred.mathworks.com> <fr98u7$e7h$1@fred.mathworks.com>
Reply-To: "Ben " <basburywvu.nospam@hotmail.com>
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 1205502662 22105 172.30.248.38 (14 Mar 2008 13:51:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 14 Mar 2008 13:51:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 425457
Xref: news.mathworks.com comp.soft-sys.matlab:457242



"us " <us@neurol.unizh.ch> wrote in message
<fr98u7$e7h$1@fred.mathworks.com>...
> "Ben ":
> <SNIP <us> was wrong
> 
> > Thanks, but not exactly what I was asking...
> 
> well, you may want to look at this solutions
> 
>      s.a='a';
>      s.b=pi;
>      s.c=magic(3);
>      fnam='foo.mat'; % <- use your file name!
>      save(fnam,'-struct','s');
>      clear s;
>      whos('-file',fnam)
>      s=load(fnam);
>      disp(s)
> 
> us

Thanks again for replying but as I stated earlier the
-struct option does not exist in Matlab 6.5 and my code must
be backwards compatible to 6.5.

I resolved the issue with eval commands(which I dislike)
since I could not find a more elegant solution.