help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Saving temporal variables


From: Oscar Bayona Candel
Subject: RE: Saving temporal variables
Date: Thu, 13 Nov 2008 13:07:51 +0100

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: address@hidden
> To: address@hidden
> CC: address@hidden
> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]