Saving temporal variables

Ben Abbott bpabbott at mac.com
Thu Nov 13 06:29:36 CST 2008


Can you provide your code?

I tried Soren's and all worked fine.

Ben

On Nov 13, 2008, at 7:07 AM, Oscar Bayona Candel wrote:

> Hi,
>
> I have tried your solution but in my code but an error appears:
>
> error: invalid vector index = 0
> error: assignment failed, or no method for `matrix = scalar'
> error: evaluating assignment expression near line 44, column 17
> error: evaluating for command near line 6, column 1
>
> line 6 is the line  for i=1:5
>
> my code work if I put for 1=1:2
> but it I put for i=1:3 the message appears
> I thought it was the 3trd calculus was wrong but if I for i=3:3 it  
> works.
>
> Can you help me to understand where is the error.
>
>
> > Subject: Re: Saving temporal variables
> > From: soren at hauberg.org
> > To: oscarbayonacandel at hotmail.com
> > CC: help-octave at cae.wisc.edu
> > Date: Wed, 12 Nov 2008 14:28:40 +0100
> >
> > ons, 12 11 2008 kl. 14:18 +0100, skrev Oscar Bayona Candel:
> > > Hi all,
> > >
> > > I have created a simply program like this:
> > >
> > >
> > > for i=1:5
> > >
> > > A=ones(10,1)+randn(10,1);
> > >
> > > end
> > >
> > > I want to save each A(i) matrix created in a ascii document or a  
> xls
> > >
> > > If I put
> > >
> > > save Data A
> > >
> > > It only saves the last A matrix how can I save these "temporal"
> > > matrices.
> >
> > How about saving your matrices in a cell array, and then saving  
> that?
> >
> > C = cell (1, 5);
> > for i=1:5
> > A=ones(10,1)+randn(10,1);
> > C {i} = A;
> > end
> >
> > save myfile.mat C
> >
> > Søren
> >
>
>
> No te aburras más, engánchate a los Juegos de Messenger  
> _______________________________________________
> Help-octave mailing list
> Help-octave at cae.wisc.edu
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave




More information about the Help-octave mailing list