[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sequential saving
From: |
Andy Buckle |
Subject: |
Re: Sequential saving |
Date: |
Fri, 16 Jul 2010 14:47:55 +0100 |
On Fri, Jul 16, 2010 at 1:22 PM, AlbFrigerio
<address@hidden> wrote:
>
> Hello everyone, I've a question about the save command : is it possible to
> make a sequential udpate of the saved data?
>
> Let's take an example : I have a matrix A1 with size(A1)=[5000,10000] and I
> save it in the file out.txt using the command save("out.txt" , "A1") . Let
> A2 be another matrix with the same sizes of A1, is it possible to save it
> below the previous one in the file out.txt ?
>
> Obviously , I could use the commands
>
> A1=load("out.txt").A1;
> A1=[A1;A2];
> save("out.txt","A1")
>
> but I don't want to use them, cause I believe that using this procedure for
> lots of times I would exhaust my Octave memory.
>
> Thanks everyone,
> Alberto
I don't think the load and save functions are your friends, in this
case. I think you have to go slightly lower level. How about something
like this.
>a=[1 2;3 4;5 6]
a =
1 2
3 4
5 6
>fid=fopen("a.txt",'w')
fid = 3
>fprintf(fid,"%.4f %.4f\r\n",a(1,:))
>fclose(fid)
ans = 0
>fid=fopen("a.txt",'a')
fid = 3
>fprintf(fid,"%.4f %.4f\r\n",a(2:3,:))
>fclose(fid)
ans = 0
>
--
/* andy buckle */