Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Saving
Date: Wed, 23 Apr 2008 12:52:56 -0400
Organization: The MathWorks, Inc.
Lines: 50
Message-ID: <funph8$6qs$1@fred.mathworks.com>
References: <funli1$56o$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1208969576 7004 144.212.105.187 (23 Apr 2008 16:52:56 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 23 Apr 2008 16:52:56 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
Xref: news.mathworks.com comp.soft-sys.matlab:464811



"Francesco " <fsarnari@maths.leeds.ac.uk> wrote in message 
news:funli1$56o$1@fred.mathworks.com...
>I tried to save my output files on
> the external hard drive using
>
> save ('E:\filename')
>
> and actually my file is saved on the E: directory,
> the only problem now being that in E: it is not
> stored as .mat file, but "Link to Microsoft Access Office".
> I don't know what to do, could you pls give me advice?

You likely installed or updated Microsoft Office since the last time you 
associated the .MAT extension with MATLAB.  My understanding is that 
Microsoft Office automatically assumes that it should associate the .MAT 
extension as a Microsoft Access Table shortcut.  If you want to make sure 
the file was saved correctly as a MAT-file that MATLAB can read, you can 
check this by loading in the file using LOAD.

> Here is the step of my code where this problem occurs:
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> for l=1:N
>
>   filename = num2str(l,'data_%d.mat');
>
>   save ('E:\filename')

This isn't going to do what you want.  It's going to save all your files as 
a file named filename on your E drive, each one but the first overwriting 
the previous.  You want to use FULLFILE:


for k = 1:N
    filename = num2str(k,'data_%d.mat');
    save(fullfile('E:', filename))
end


[As a personal preference, I try to avoid using i, j, or lower case L as 
loop indices.  The former are too useful as sqrt(-1); the latter is too easy 
to confuse with the number 1.]

-- 
Steve Lord
slord@mathworks.com