From help-octave-request at bevo dot che dot wisc dot edu Wed Dec 5 12:05:16 2001 Subject: "-mat-binary" (was : Re: Is it possible to save structs?) From: "E. Joshua Rigler" To: mark dot esplin at sdl dot usu dot edu Cc: Help-Octave Date: 05 Dec 2001 11:04:31 -0700 This is almost completely unrelated, but I'll ask in this thread anyway. I almost always use "-mat-binary" to save sessions, just so I can bring it up in Matlab if need-be. I often use the xcov/xcorr functions, which can return a "lag" vector. This is an N-column row vector of the time-lags associated with the correlation function. If this vector is in memory (it doesn't matter what it is called), I get an error when trying to save all my variables to "-mat-binary". Just to waste band-width, I've attached a summary of commands and output that illustrate this problem. Is the "lag" vector returned from the xcov/xcorr functions a strange data-type? This is just weird, but not any kind of show-stopper. I use 2.1.34 under RH Linux 7.1. -EJR ----- octave:217> save -mat-binary og.mat * warning: save: wrong type argument `range' warning: near line 217, column 1: >>> save ("-mat-binary", "og.mat", "*") error: save: error while writing `lag' to MAT file octave:217> octave:217> octave:217> whos la* *** local user variables: prot type rows cols name ==== ==== ==== ==== ==== rwd range 1 481 lag octave:218> tmp = lag; octave:219> clear lag octave:220> save -mat-binary og.mat * warning: save: wrong type argument `range' warning: near line 220, column 1: >>> save ("-mat-binary", "og.mat", "*") error: save: error while writing `tmp' to MAT file octave:220> whos tmp *** local user variables: prot type rows cols name ==== ==== ==== ==== ==== rwd range 1 481 tmp octave:221> octave:221> octave:221> test test test_out octave:221> test_lag = ones (1,481); octave:222> clear tmp octave:223> save -mat-binary og.mat * octave:224> whos test_lag *** local user variables: prot type rows cols name ==== ==== ==== ==== ==== rwd matrix 1 481 test_lag On Wed, 2001-12-05 at 09:06, Mark Esplin wrote: > You can save and load structs using the Matlab binary format. That is use: > > save -mat-binary "test" a > > -Mark Esplin > > On Wednesday 05 December 2001 07:26 am, Roberto Hernandez wrote: > > Hey everyone, > > > > When trying to save structures I get the following message: > > > > ----------------------------------- > > octave:3> a > > a = > > { > > b = 1 > > c = 2 > > } > > octave:4> save "Test" a > > warning: save: wrong type argument `struct' > > > > warning: near line 4, column 1: > > >>> save ("Test", "a") > > > > ----------------------------------- > > _________________________________________________________ > Do You Yahoo!? > Get your free at yahoo dot com address at http://mail.yahoo.com > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web: http://www.octave.org > How to fund new projects: http://www.octave.org/funding.html > Subscription information: http://www.octave.org/archive.html > ------------------------------------------------------------- ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------