Skip to main content

All Questions

Tagged with
0 votes
1 answer
1k views

Editing .mat file in Python [duplicate]

I am trying to import a .mat (not human readable) file in python I imported it using a package called AT. import at from at.plot import plot_beta import time import matplotlib.pyplot as plt r = at....
Esalah's user avatar
  • 27
1 vote
2 answers
6k views

How to convert matlab code to python code automatically

I have a huge Matlab code that I want to convert to Python, my code is more than 10K lines of code, in addition, it includes some calls to other Matlab files, toolboxes, plots, and GUI figures. ...
abdullatif's user avatar
1 vote
0 answers
54 views

Python - cdll immediately crashes program after upgrading from Python 2.7 to 3.8

I am in the process of upgrading a project from python 2.7 to 3.8, which involved a call of a function from a dll. This dll was actually generated with MATLAB's codegen utility. The header of the ...
malnooshna's user avatar
0 votes
0 answers
615 views

Can't import matlab.engine in Matlab

I installed the matlab module for python using this tutorial. Now I'm trying to import matlab.engine module in a .py file that's going to be executed inside Matlab. Here is the process and files: My ...
João Paulo's user avatar
  • 6,730
1 vote
1 answer
122 views

Matlab code to Python code Conversion ( Using data frames)

So I am working on changing a Matlab code to python code, for visualizing a graph. This code is basically used working on data from radar signals. Here is the Matlab code. data1 = csvread('...
Ramneek Paul Singh's user avatar
0 votes
1 answer
903 views

Multiple errors attempting to solve a function with fsolve and sym solve in python

I am trying to solve the function below. I've attempted to use a symbolic solver and fsolve. Both are causing me trouble. First time posting, I apologize in advance if I'm missing something in my ...
Rei's user avatar
  • 3
0 votes
1 answer
1k views

Bandpass filtering at low frequencies

I would like to know if there is any best practice to solve the following problem which I think may be of general interest. I have a signal sampled with 40 kHz for about 60s. That signal contains ...
Rickson's user avatar
  • 1,090
0 votes
0 answers
140 views

How to get user input into MatLab script called from Python script

I am calling a MatLab script from a python script and my MatLab script requires user input. When I am prompted for input the terminal doesn't allow input. Am I able to get user input into the MatLab ...
SPYBUG96's user avatar
  • 1,127
0 votes
1 answer
213 views

Python Package from Library Compiler: Matlab Runtime Error: Index exceeds matrix dimensions

I have a function in Matlab. I created a python package from it to use in my python code. So far so good. When i call the function in python i received the message: MatlabRuntimeError: An error ...
underfloor's user avatar
0 votes
1 answer
72 views

syntax of a line of code from matlab to python

I have this line of code over here in Matlab: DCT_matrix = orig_img(row: row + blocksize-1, col: col + blocksize-1); I'd like to translate it in python but I can't seem to figure out the function of ...
EAgamy's user avatar
  • 3
-1 votes
1 answer
1k views

sparse matrix: Matlab to Python code conversion

How should I convert this from Matlab into Python: A = sparse(row_idx, col_idx, values, len, s1 * s2); scales = zeros(size(A, 1), 1); scales(sub2ind([s1 s2], floor(frames(2, :)), floor(frames(1, :))))...
CIsForCookies's user avatar
0 votes
1 answer
276 views

Matlab crashes when trying to call Python's execfile function

I am trying to call a simple Python script from within Matlab and unfortunately Matlab crashes. I am on Windows 10. I am doing this by calling py.execfile(filePathAndName) in Matlab's interactive ...
peter.petrov's user avatar
  • 39.5k
0 votes
1 answer
518 views

Pythonengine Matlab cannot find attributes like 'find_matlab'

I am running python 2.7 and matlab2015a from a virtual environment. Both matlab and python are properly in the path (I can start them from terminal). But, whenever I do this: python from matlab....
Lester Smith's user avatar
1 vote
2 answers
192 views

Matlab to Python

I have a simple code in MATLAB which I am trying to translate to python, but I am stuck in a simple for loop: Here is the situation: Matlab f0 = constant fn = (nx1) matrix b = (nx1) matrix d and x ...
stackword_0's user avatar
0 votes
1 answer
743 views

Dividing a image into multiple images of equal pixel data [closed]

I have a greyscale image im If total is the sum of all pixels' values, how do I split im into 5 images with the following properties: sum of all pixels' values is 1/5 of total missing requirements... ...
Amrit Das's user avatar

15 30 50 per page
1
2 3 4 5 6