help-octave
[Top][All Lists]
Advanced

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

Re: Referencing variable within a new variable


From: Jordi Gutiérrez Hermoso
Subject: Re: Referencing variable within a new variable
Date: Thu, 25 Apr 2013 13:53:07 -0400

On 25 April 2013 13:41, epetting <address@hidden> wrote:
> I am having a basic issue doing the following:
> Where data is a document
>
> for tag=1:4
> GS_$tag=data{tag}
> end
>
> So that GS_1=data{1} , GS_2=data{2} , etc?

Why not use GS{1} instead of GS_1? Are you trying to mimic notation in
some mathematical paper you're reading? The right way to mimic a_1,
a_2, ..., a_n in Octave is to do a(1), a(2), ..., a(n) or a{1}, a{2},
..., a{n}.

HTH,
- Jordi G. H.


reply via email to

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