Hello,
I want to convert a string which contains a formula but once i want to use it as a float, it doesn't work.
Look at my script to understand the problem :
the_array = #()
for t = 0 to 100 do (append the_array t)
------------------------------------------------------------------------------------------------
-- replace tt in string by the_array[t]
------------------------------------------------------------------------------------------------
formula = "(" + "cos((tt*2)*(180/pi))+tt" + ")"
tokens = filterString formula "tt" splitEmptyTokens:true
for i = 1 to tokens.count do
(
if tokens[i] == "" do
(
tokens[i] = "(the_array[t])"
)
)
formula = ""
for i = 1 to tokens.count do
(
formula += tokens[i]
)
------------------------------------------------------------------------------------------------
x_matrix = bigMatrix 1 the_array.count
for t = 1 to the_array.count do
(
formula = formula as float
x_matrix[1][t] = formula -- I want to have formula = (cos((the_array[t]*2)*(180/pi))+the_array[t])
)
By Rodman · 2012-11-01
Anubis · 2012-11-01