[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Evaluating a string in octave
From: |
antonio palestrini |
Subject: |
Re: Evaluating a string in octave |
Date: |
Mon, 29 Jan 2007 15:06:50 +0100 |
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)
antonio
2007/1/29, Doug Stewart <address@hidden>:
I have a string in octave that looks like this:
( it was produced with my new Inverse Z Transform function)
+ 15 * (0.5)^(K) -35 * (0.7)^(K) + 20 * (1)^(K)
and I put this string in q
q = + 15 * (0.5)^(K) -35 * (0.7)^(K) + 20 * (1)^(K)
Now I want to give K a value and then evaluate the formula.
K=5
m=evaluate(q)
How do you do this?
Doug
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave
--
Prof. Antonio Palestrini
DSGSS - University of Teramo, Italy
e-mail: address@hidden
- Wikibook on octave, Nicolas Pettiaux, 2007/01/29
- Re: Wikibook on octave, David Bateman, 2007/01/29
- Evaluating a string in octave, Doug Stewart, 2007/01/29
- Re: Evaluating a string in octave,
antonio palestrini <=
- Re: Evaluating a string in octave, Muthiah Annamalai, 2007/01/29
- Re: Evaluating a string in octave, antonio palestrini, 2007/01/29
- Re: Evaluating a string in octave, antonio palestrini, 2007/01/29
- Re: Evaluating a string in octave, David Bateman, 2007/01/29
- Re: Evaluating a string in octave, Doug Stewart, 2007/01/29
Re: Wikibook on octave, Nicolas Pettiaux, 2007/01/29
Re: Wikibook on octave, Nicolas Pettiaux, 2007/01/30