[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 14:04:31 -0400 |
On 25 April 2013 13:56, Nir Krakauer <address@hidden> wrote:
> or, if you have to use different variable names, do
>
> eval(["GS_" num2str(tag) "=data{tag};"])
I really discourage trickery with string manipulation and eval just so
you can write GS_1 instead of GS{1}. I routinely read code like this
where everything is peppered with string manipulation and eval just to
reimplement variable indexing using underscores. The Octave language
already has variable indexing. There is no need to reimplement it.
- Jordi G. H.