Octave and PHP

Gerard Choinka kagozu at discardmail.com
Fri Jul 25 08:37:15 CDT 2008



Christopher Back wrote:
> If someone could provide a layout of how to implement Octave or
> point me in the direction of a good example I would really appreciate it.
> thanks.

in php
start "octave -q script" with popen

create a string in php e.g. "input_data = [102 10 10 10 10 10];"

write this string to the pipe

in octave

recive the string with fread on stdin
let the eval function do the job
calculate

print the result with printf in php syntax "$result = array(12,10,9,12,)"

php
read the output from the pipe (with php fread)
use phps eval function


but using eval with octave and php is a security risk, to avid eval parse
the matrix wird scanf

this is also not the fastes way to use octave (the octave startup needs a
lot of time)






-- 
View this message in context: http://www.nabble.com/Octave-and-PHP-tp18639959p18651908.html
Sent from the Octave - General mailing list archive at Nabble.com.



More information about the Help-octave mailing list