Questions tagged [oct2py]

Oct2Py is a Python library that allows the user to seamlessly call M-files and Octave functions from Python.

Oct2Py is a Python library which allows for seamless integration between Python and Octave. It manages the Octave session for you and transfers data between Python and the Octave session using MAT files.

Additionally, it provides OctageMagic which allows for integration of Oct2Py into Jupyter notebooks.

Example

from oct2py import Oct2Py

# Create an Octave session
oc = Oct2Py()

# Call an Octave function
x = oc.zeros(3, 3)

print(x, x.dtype)

#   [[ 0.  0.  0.]
#    [ 0.  0.  0.]
#    [ 0.  0.  0.]] float64

References

56 questions
0
votes
1 answer

Oct2py binary operator '*' not implemented

I'm using oct2py to execute an octave function from python, and I get the following error: oct2PyError: Octave evaluation error: error: binary operator '*' not implemented for 'int64 scalar' by 'complex matrix' operations In python, im just…
eduardosufan
  • 1,441
  • 2
  • 23
  • 51
0
votes
1 answer

importing oct2py in python2.7.9 gives WindowsError: [Error 2] The system cannot find the file specified

While importing oct2py module, here what i got.. >>> import oct2py Traceback (most recent call last): File "", line 1, in import oct2py File "C:\Python27\lib\site-packages\oct2py\__init__.py", line 38, in
PuNiT
  • 15
  • 4
0
votes
1 answer

Unable to run a octave function using oct2py through the web server

I am using oct2py to call a octave function in my python code. The file is saved as .py file in the htdocs folder. #!/usr/bin/python import cgi import oct2py from oct2py import octave print('Content-type:text/html\r\n\r\n') print('
amathur
  • 11
  • 2
0
votes
2 answers

Change dtype data_type fields of numpy array

I have a .mat file which I load using scipy: from oct2py import octave import scipy.io as spio matPath = "path/to/file.mat" matFile = spio.loadmat(matPath) I get a numpy array which I want to pass to octave function using oct2py, like…
galah92
  • 3,621
  • 2
  • 29
  • 55
0
votes
1 answer

Peak detection gives different results when using octave or oct2py in python

I am trying to fit a number of fixed width gaussians to a single broad peak. The only way I have been able to do this is with peakfit.m. Sample data can be downloaded here. In octave the code I use…
Peaksandpeaks
  • 57
  • 1
  • 8
0
votes
1 answer

Jupyter Octave Kernel on Windows7

Followed the instructions at https://github.com/Calysto/octave_kernel to install octave_kernel on a Windows1 machine and everything went ok. However, when I select Octave as my kernal from Jupyter, the following occurs. The kernel has died, and…
Clay
  • 2,584
  • 1
  • 28
  • 63
0
votes
0 answers

Oct2Py on Windows 10 hanging

I previously had Oct2Py version 3.4.0 working with Octave 4.0.0 on windows 7, but now I am trying to get Oct2Py on Windows 10. The install worked just fine and I can import Oct2Py, but when I try to run oct2py.addpath("some\path") My python…
0
votes
1 answer

Oct2PyError occurs in ipython when octavemagic is used

I want to use octave functionality from ipython. Therefore,I installed oct2py module by pip command. (To be precise, I'm using ipython3 and pip3 command) The installation itself was done successfully. According to this web page, I tried following…
yufit_in_Japan
  • 583
  • 11
  • 23
0
votes
1 answer

Printing to-be-displayed values in oct2py

In Matlab/Octave, if an expression does not end with a semicolon ; to silence it, its value is displayed on the output. However, this does not happen in oct2py - these values are printed only in case an exception happens later. I'd like to either…
Petr Baudis
  • 1,178
  • 8
  • 13
-1
votes
1 answer

`FSolve` error when running matlab code in python using `Oct2py`

I have a matlab function which uses fsolve built-in function. It works well on matlab side. When I try to run that matlab function in python using Oct2py, I face this error. Please help me with this error. Thanks in advance.
Tienn
  • 9
  • 4
-2
votes
1 answer

Octave library - 'MeanPeakHeight' invalid parameter

I would like to do a peak detection of a .wav file signal in Python with Octave library on a Raspberry pi 3 with Raspbian but there is a problem with the octave.findpeaks function. I had this error:findpeaks : argument 'MeanPeakHeight' did not…
T.Justice
  • 75
  • 1
  • 2
  • 13
1 2 3
4