From help-request at octave dot org Fri Dec 17 14:37:45 2004 Subject: Re: save;load question From: Geraint Paul Bevan To: D Goel CC: help at octave dot org Date: Fri, 17 Dec 2004 20:47:53 +0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 D Goel wrote: | So, how do i extract the actual value of the matrix inside the program | from this structure? (Note that the program does not know that the | name of the variable is M). You can loop over the structure using the "for [val, key] = structure" construct. octave> M = [ 1, 2 ; 4 , 3 ] M = ~ 1 2 ~ 4 3 octave> save ( "file.dat", "M" ) octave> data = load ( "file.dat" ) data = { ~ M = ~ 1 2 ~ 4 3 } octave> for var = data; endfor octave> var var = ~ 1 2 ~ 4 3 - -- Geraint Bevan http://homepage.ntlworld.com/geraint.bevan -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iEYEARECAAYFAkHDRfgACgkQcXV3N50QmNM7OwCfRRy1HaiI7pROE9tzUh0vAISJ XzUAnj40SSefS4JHDwiZoGD4Owk+zCoW =nB8Z -----END PGP SIGNATURE----- ------------------------------------------------------------- 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 -------------------------------------------------------------