help-octave
[Top][All Lists]
Advanced

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

Re: Evaluating a string in octave


From: Muthiah Annamalai
Subject: Re: Evaluating a string in octave
Date: Mon, 29 Jan 2007 10:08:53 -0600

On Mon, 2007-01-29 at 15:06 +0100, antonio palestrini wrote:
> If I interpret the question correctly, you have a string
> in the variable q .. so something like
> 
> q = " 15 *  (0.5)^(K)   -35 *  (0.7)^(K)  + 20 *  (1)^(K)";
> (note: strings are inside commas ".....")
> 
> in this case just type
> 
> k=5; eval (q)
> 
or rather, K=5; eval(q)
or in CVS 2.9.8+ (and maybe even earlier) the following
works:  

 either:  z=inline(q); z(5) 
 or:      inline(q)(5);

-Muthu





reply via email to

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