help-octave
[Top][All Lists]
Advanced

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

Re: how to use a variable for naming another variable in octave


From: Søren Hauberg
Subject: Re: how to use a variable for naming another variable in octave
Date: Mon, 10 Nov 2008 23:09:43 +0100

man, 10 11 2008 kl. 22:46 +0100, skrev Luca Penasa:
> Is possible to use a variable for naming another one in an iterative
> process like in bash language? I would like something like this:
> 
> for i = 1:50
>       result_$i = function(data,i);
> endfor

something like

for i = 1:50
  eval (sprintf ("result_%d = function (data, %d);", i, i);
endfor

should work, but I haven't tested it.

Søren



reply via email to

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