<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168132</link>
    <title>MATLAB Central Newsreader - Saving</title>
    <description>Feed for thread: Saving</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 23 Apr 2008 15:45:05 -0400</pubDate>
      <title>Saving</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168132#428453</link>
      <author>Francesco </author>
      <description>I tried to save my output files on&lt;br&gt;
the external hard drive using&lt;br&gt;
&amp;nbsp;&lt;br&gt;
save ('E:\filename')&lt;br&gt;
&amp;nbsp;&lt;br&gt;
and actually my file is saved on the E: directory,&lt;br&gt;
the only problem now being that in E: it is not&lt;br&gt;
stored as .mat file, but "Link to Microsoft Access Office".&lt;br&gt;
I don't know what to do, could you pls give me advice?&lt;br&gt;
&amp;nbsp;&lt;br&gt;
Here is the step of my code where this problem occurs:&lt;br&gt;
&lt;br&gt;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br&gt;
&amp;nbsp;&lt;br&gt;
for l=1:N&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;filename = num2str(l,'data_%d.mat');&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;save ('E:\filename')&lt;br&gt;
&amp;nbsp;&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br&gt;
&amp;nbsp;&lt;br&gt;
I would like to end up on the E: directory with a set of &lt;br&gt;
files:&lt;br&gt;
&amp;nbsp;&lt;br&gt;
data_1.mat&lt;br&gt;
data_2.mat&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
data_N.mat&lt;br&gt;
&lt;br&gt;
Many thanks,&lt;br&gt;
Francesco&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 23 Apr 2008 16:02:45 -0400</pubDate>
      <title>Re: Saving</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168132#428455</link>
      <author>David </author>
      <description>"Francesco " &amp;lt;fsarnari@maths.leeds.ac.uk&amp;gt; wrote in message &lt;br&gt;
&amp;lt;funli1$56o$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I tried to save my output files on&lt;br&gt;
&amp;gt; the external hard drive using&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; save ('E:\filename')&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; and actually my file is saved on the E: directory,&lt;br&gt;
&amp;gt; the only problem now being that in E: it is not&lt;br&gt;
&amp;gt; stored as .mat file, but "Link to Microsoft Access &lt;br&gt;
Office".&lt;br&gt;
&amp;gt; I don't know what to do, could you pls give me advice?&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; Here is the step of my code where this problem occurs:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; for l=1:N&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;    filename = num2str(l,'data_%d.mat');&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;    save ('E:\filename')&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; end&lt;br&gt;
&lt;br&gt;
the save should be:&lt;br&gt;
&lt;br&gt;
save(['E:&amp;#092;' filename]);&lt;br&gt;
&lt;br&gt;
or you could do:&lt;br&gt;
&lt;br&gt;
filename = num2str(l,'E:\data_%d.mat');&lt;br&gt;
save (filename)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
you are not substituting the variable 'filename' you are &lt;br&gt;
saving to the file named 'filename'.&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 23 Apr 2008 16:52:56 -0400</pubDate>
      <title>Re: Saving</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168132#428465</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
"Francesco " &amp;lt;fsarnari@maths.leeds.ac.uk&amp;gt; wrote in message &lt;br&gt;
news:funli1$56o$1@fred.mathworks.com...&lt;br&gt;
&amp;gt;I tried to save my output files on&lt;br&gt;
&amp;gt; the external hard drive using&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; save ('E:\filename')&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; and actually my file is saved on the E: directory,&lt;br&gt;
&amp;gt; the only problem now being that in E: it is not&lt;br&gt;
&amp;gt; stored as .mat file, but "Link to Microsoft Access Office".&lt;br&gt;
&amp;gt; I don't know what to do, could you pls give me advice?&lt;br&gt;
&lt;br&gt;
You likely installed or updated Microsoft Office since the last time you &lt;br&gt;
associated the .MAT extension with MATLAB.  My understanding is that &lt;br&gt;
Microsoft Office automatically assumes that it should associate the .MAT &lt;br&gt;
extension as a Microsoft Access Table shortcut.  If you want to make sure &lt;br&gt;
the file was saved correctly as a MAT-file that MATLAB can read, you can &lt;br&gt;
check this by loading in the file using LOAD.&lt;br&gt;
&lt;br&gt;
&amp;gt; Here is the step of my code where this problem occurs:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; for l=1:N&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;   filename = num2str(l,'data_%d.mat');&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;   save ('E:\filename')&lt;br&gt;
&lt;br&gt;
This isn't going to do what you want.  It's going to save all your files as &lt;br&gt;
a file named filename on your E drive, each one but the first overwriting &lt;br&gt;
the previous.  You want to use FULLFILE:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
for k = 1:N&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;filename = num2str(k,'data_%d.mat');&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;save(fullfile('E:', filename))&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
[As a personal preference, I try to avoid using i, j, or lower case L as &lt;br&gt;
loop indices.  The former are too useful as sqrt(-1); the latter is too easy &lt;br&gt;
to confuse with the number 1.]&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
