Community Profile

photo

Al Danial


Last seen: Today 2022 以来アクティブ

Author, Python for MATLAB Development, https://www.apress.com/gp/book/9781484272220 Author, cloc, https://github.com/AlDanial/cloc

Programming Languages:
Python, C++, C, MATLAB, SQL, Perl, Fortran

Statistics

All
  • 6 Month Streak
  • Knowledgeable Level 2
  • First Submission
  • GitHub Submissions Level 1
  • Thankful Level 1
  • First Answer

バッジを表示

Content Feed

表示方法

回答済み
Passing Python function input arguments from Matlab
Wrap your MATLAB matrices with py.numpy.array() instead of py.numpy.ndarray() in your call.

約10時間 前 | 0

| 採用済み

回答済み
Calling Python from Matlab / Can I use Python installed by Anaconda? / "NULL pointer returned from Python."
Try this start-up sequence: first open an Anaconda Prompt or Anaconda PowerShell terminal. Then within that terminal window, t...

4日 前 | 0

回答済み
How can I import python module properly instead of namespace package
Try assigning the import to a variable: asammdf = py.importlib.import_module('asammdf'); then MDF = asammdf.MDF();

18日 前 | 0

回答済み
How can I translate these Matlab statistics into Python?
If this 3840 x 2160 matrix is the only data in the file you could do import numpy as np Yd = np.fromfile('file_with_matrix.bin...

27日 前 | 0

回答済み
How to convert a 1x5x5600 cell in MATLAB to a python list that is (1,5,5600)
Lists, like cell arrays, may be nested so @J C's request is doable. Here's an example with a 1x3x5 cell: % create the cell arr...

2ヶ月 前 | 0

回答済み
list comprehension in MATLAB using Python interface
MATLAB's cellfun() and arrayfun() act like Python list comprehensions. You can give them Python functions to act on each item i...

2ヶ月 前 | 0

回答済み
Unable to resolve the name 'py.anything' when using Homebrew Python
I won't have a macOS machine handy for a while so I can't experiment. I imagine the MathWorks tech support would know... unless...

2ヶ月 前 | 1

回答済み
pyenv Library property empty. Unable to resolve the name (Linux:Pop OS 22.04, python 3.9, R2022a)
On my Ubuntu 20.04 system pyenv returns >> pyenv ans = PythonEnvironment with properties: Version: "3.9" Executable: "/usr...

2ヶ月 前 | 1

送信済み


Python for MATLAB Development
Source Code for 'Python for MATLAB Development' by Albert Danial

3ヶ月 前 | ダウンロード 4 件 |

Thumbnail

回答済み
Matlab numpy array: AttributeError: 'array.array' object has no attribute 'fromstring'
Regarding @Ben 's initial issue, the matlab/python version compatibility table, https://www.mathworks.com/content/dam/mathworks/...

3ヶ月 前 | 0

回答済み
Run pickle file in matlab
This shows how to load a pickle file into MATLAB: pickle = py.importlib.import_module('pickle'); fh = py.open('data.pkl', 'rb'...

4ヶ月 前 | 3

回答済み
From Python to Matlab
I'm willing to help. How about posting your first cut at the Python code and showing where you're stuck?

4ヶ月 前 | 0

回答済み
reshape a cell array to be row major
Your first sentence, "Maybe storing the data in a table will end up being more convenient:" proved to be the key. With that ide...

4ヶ月 前 | 0

質問


reshape a cell array to be row major
If I load data with textscan() I'll get back a cell array holding the columns of data. For example fh = fopen('log.txt'); x =...

4ヶ月 前 | 2 件の回答 | 0

2

回答

回答済み
convert a py.str to a matlab string
For generic conversion of Python variables to MATLAB variables, try py2mat.m, and for the reverse (Python to MATLAB), mat2py.m. ...

4ヶ月 前 | 0

回答済み
Convert MATLAB Code to Python Code (.ipynb)
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt N = 500 M = np.diag(np.ones((N-1,)),1) + np.diag(np...

5ヶ月 前 | 0

| 採用済み

回答済み
How do I create a 3 dimensional surface from X Y Z points
Since you're starting in Python you can make the surface plot there too if you want. This is a translation of @Star Strider's m...

5ヶ月 前 | 0

回答済み
unable to resolve the name py.function error
Couple of things to try: 1) change the execution mode to InProcess >> pyenv('ExecutionMode', 'InProcess') 2) open a terminal ...

5ヶ月 前 | 1

回答済み
Python function to Matlab
Looks like monthly_raw_data is a Pandas dataframe. Can you post a small input file (.csv or other) that loads into a representa...

5ヶ月 前 | 0

回答済み
Convert numpy ndarray to matlab mlarray in python
Looks like you're making the data load unnecessarily complicated. The file actually loads cleanly into a NumPy array: from sci...

5ヶ月 前 | 0

| 採用済み

回答済み
How to get frequencies of a s parameter object in python
Let's see what is in your variable sp. Make a small version of it, save it to a .mat file, and attach the .mat file here.

5ヶ月 前 | 0

回答済み
Convert numpy ndarray to matlab mlarray in python
Now I'm curious what is in your variable x. Can you make a small version of this data, write it to a .mat file, then attach the...

5ヶ月 前 | 0

回答済み
Matlab 2019a Ubuntu 20 Python 3.7.12 "Path argument does not specify a valid executable"
Does the command pyenv work in 2019a? If yes, what output does it show? 2020b uses pyenv to show what MATLAB thinks the Python...

6ヶ月 前 | 0

回答済み
System command and Unix parallelisation
Independently of MATLAB, can you run run_command_1_para.sh directly from a Unix terminal and get the behavior you want? If that...

6ヶ月 前 | 0

回答済み
Convert numpy ndarray to matlab mlarray in python
Which version of MATLAB? 2020a and newer (I don't have easy access to older versions) should just be able to do >> mx = doubl...

6ヶ月 前 | 0

回答済み
Calling python modules gives ModuleNotFoundError.
Does the MATLAB code change directories before calling the import command? If you interactively invoke the import in a fresh MA...

6ヶ月 前 | 0

回答済み
How to transfer Big Data from Python Dict to Matlab
Alternatively, write your Big Data dictionary directly to a MATLAB .mat file as described here: https://www.mathworks.com/matlab...

6ヶ月 前 | 0

回答済み
convert a Python tuple containing string and numerical data types to Matlab
The SciPy module has a function, savemat, which can write Python variables to MATLAB .m files. Your tuple can be written to tes...

6ヶ月 前 | 0