[scilab-Users] [SPAM] save variables in an existing file

Antoine Monmayrant antoine.monmayrant at laas.fr
Tue Apr 3 22:01:01 CEST 2012


Le 03/04/12 19:31, Adrien Vogt-Schilb a écrit :
> On 02/04/2012 20:43, Antoine Monmayrant wrote:
>> Le 02/04/12 18:00, Adrien Vogt-Schilb a écrit :
>>> Hy
>>>
>>> Does anybody knows a way to save various varibales in a single files 
>>> in scilab?
>> Yop:
>> a=1;b=2;
>> save("ab.mat",a,b);
>> listvarinfile("ab.mat");
>> clear a b;
>> load("ab.mat");
>
> hi
>
> Thank you
>
> I meant in an existing file.
Ah, sorry, I didn't get it.
> The save help page says one can do this:
>
> // creating the file
> fd=mopen  <mopen.html>('TMPDIR/foo','wb')
> k=1,  x=k^2;
> save(fd,x,k)
> mclose  <mclose.html>(fd)
>
> // appending variables to an old save file
> fd=mopen  <mopen.html>('TMPDIR/foo','r+')
> mseek  <mseek.html>(0,fd,'end')
> lst=list  <list.html>(1,2,3)
> save(fd,lst)
> mclose  <mclose.html>(fd)
>
>
> but the created file is not readable by load
Well, you can always get dirty and inefficient: reload file old content 
and resave old+new variables in another file ...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20120403/e4a93689/attachment.htm>


More information about the users mailing list