Path: news.mathworks.com!not-for-mail
From: Edric M Ellis <eellis@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to save data when using remote cluster
Date: Wed, 04 Nov 2009 08:35:09 +0000
Organization: The Mathworks, Ltd.
Lines: 30
Message-ID: <ytwzl72g01u.fsf@uk-eellis-deb5-64.mathworks.co.uk>
References: <hcqa6r$3mk$1@fred.mathworks.com>
NNTP-Posting-Host: uk-eellis-deb5-64.mathworks.co.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: fred.mathworks.com 1257323709 29025 172.16.27.232 (4 Nov 2009 08:35:09 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 4 Nov 2009 08:35:09 +0000 (UTC)
X-Face: $Ahg}Iylezql"r1WV1Me5&)ng"a4v%D>==KMs-elCfj"o}$bh-VOt7lVXgLWsC?9mZ`mINT
 G6PDvca;nrgs$lfcr0l1ew'N]>nXKl}m|Zpg>,6*gLp~-N0N2*+b.iwv=u>@R$L4SEG&NYUU;lSR@u
 IHphdAy
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)
Cancel-Lock: sha1:ve1IvI5gmth6hs4RsYGnOH91w/k=
Xref: news.mathworks.com comp.soft-sys.matlab:582289


"chaosheng " <csudeng@126.com> writes:

> hey, I am trying to save data in a file when I run my job on a remote cluster,
> but i don't know how to save.
>
> This is the script; [...]
>
> this is test.m which is in my working directory.
>
> function out = test
> x = 1;
> y = 2;
> save('testSaveData.mat','x','y')
> out = x+y;
>
> After I run the script I can get the results as results{1} =3. but I couldn't
> get the file of testSaveData.mat.

That will save "testSaveData.mat" into the current directory of the workers,
probably not what you want (since that may be a temporary directory
somewhere). I would recommend putting in a full path to some location shared by
the workers and the client, e.g.

save( '/home/me/data/testSaveData.mat', 'x', 'y' );

or similar.

Cheers,

Edric.