I am willing to call Octave from my python script without using the python package oct2py
(I'm having troubles importing it). I am aware of the use of the subprocess
package, but how can I extract the output of an Octave function from this command. I rephrase: say I have a function that computes the fft defined as follows:
function [A,f]=fft_of_signal(Value,T)%coumputes A and f end
Calling this from Octave goes as follows:
octave:1> [v,f]=fft_of_signal(value,T)
.
How can I use subprocess
to ask for the computed values of v and f?
subprocess.run(['octave-cli.exe','[v,f]=fft_of_signal(value,T);'])
?
Thanks in advance!
question from:https://stackoverflow.com/questions/65844136/write-an-octave-command-line-in-python-and-extract-the-outputs