Thread Subject:
mat files append

Subject: mat files append

From: Snow White

Date: 24 Apr, 2009 16:36:01

Message: 1 of 2

Hi,

I am trying to append data into a mat file as it gets computed using the following code

savefile = 'test.mat';
if exist('test.mat')
    save(savefile, 'x','y','polang','I_max','I_min','temp_rho', 'A','B','C','r','-append');
else
    save(savefile, 'x','y','polang','I_max','I_min','temp_rho', 'A','B','C','r','-append');
end

but it overwrites the data and does not append it.

Bye

Subject: mat files append

From: Yi Cao

Date: 1 May, 2009 16:16:01

Message: 2 of 2

"Snow White" <gulesaman@gmail.com> wrote in message <gsspph$6p3$1@fred.mathworks.com>...
> Hi,
>
> I am trying to append data into a mat file as it gets computed using the following code
>
> savefile = 'test.mat';
> if exist('test.mat')
> save(savefile, 'x','y','polang','I_max','I_min','temp_rho', 'A','B','C','r','-append');
> else
> save(savefile, 'x','y','polang','I_max','I_min','temp_rho', 'A','B','C','r','-append');
> end
>
> but it overwrites the data and does not append it.
>
> Bye

-append option is to append new variables to the existing file but is not to append existing variables with new values. If you wish to append new values to the existing variables, you have to load these existing variables first, appending them in the workspace then to save appended variables to the existing mat file.

HTH
Yi Cao

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
matlab Snow White 24 Apr, 2009 12:40:19
mat files Snow White 24 Apr, 2009 12:40:19
append Snow White 24 Apr, 2009 12:40:19
rssFeed for this Thread

Contact us