|
"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
|