|
From: Bruno Eklund on 7 May 2008 06:56 roberson(a)ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in message <fv2a0k$t3h$1(a)canopus.cc.umanitoba.ca>... > In article <fv22n6$ptb$1(a)fred.mathworks.com>, > Dimitris <dim1984(a)hotmail.com> wrote: > >roberson(a)ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in > >message <fv0q0g$iac$1(a)canopus.cc.umanitoba.ca>... > >> In article <fv0m2e$meg$1(a)fred.mathworks.com>, > > >> No, not unless you are using save with -ascii -append > >> (in which case you can't tell what output is from which > >variable > >> anyhow.) > > >Thanks for your reply > >So is there no a way to save the values of an array for > >different iterations of the program for processing? > > The Matlab help on save -append specifically says that it will > overwrite variables with the same name. This makes the work-around > obvious: use a different name for the variable each time. > Hi Dimitris and Walter, actually, you don't need to use different variable names. What you do is to first load the variable you want to append something new to by load('myfile.mat','a'). Then append your new values to the end of a, and then save it using the -append option, save('myfile.mat','a', '- append'). Note that you need a temporary variable name for your new variable a, since the name of a in the mat-file can't be changed when you load it.
|
Pages: 1 Prev: Getting variable as filename Next: Pilot insertion in data Stream with Simulink |