[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: appending data in a binary file
From: |
taltman |
Subject: |
Re: appending data in a binary file |
Date: |
Thu, 6 Nov 2003 20:39:59 +0000 (UTC) |
Fresh from the oven! :-)
Attached, please find my M-file named "apend_save.m" .
function: append_save
arguments: 3+additional
1st: string for file name
2nd: string for options to pass to load & save ( i.e., "-binary" )
3rd: a 1x2 cell with the first cell element being a string for the
variable name, and the 2nd cell being the variable value.
4th: can accept additional cells of the same format as "3rd" above.
Exampe:
octave> A = zeros(2,2);
octave> save -binary "test.txt" A
octave> clear A
octave> B = ones(2,2);
octave> append_save( "test.txt", "-binary", {"B", B } )
octave> clear B
octave> A
error: `A' undefined near line 147 column 1
octave> B
error: `B' undefined near line 147 column 1
octave> load -binary "test.txt"
octave> A
A =
0 0
0 0
octave> B
B =
1 1
1 1
-- <end example> --
Please give me feedback on this hack.
Thanks,
~Tomer
On Nov 6, 2003 at 10:27pm, charo wrote:
rbalbo >Hi all,
rbalbo >
rbalbo >is there a way to append data to an Octave binary file?
rbalbo >
rbalbo >Thanks,
rbalbo >
rbalbo >R
append_save.m
Description: append_save.m