mat2py
For instance usage, try the Online Matlab Emulator here. Please note:
- You may need the latest modern browser for using this APP(check the console log by pressing F12).
- Loading the environment may take quite long time, especially for the first time. Try refresh the page incase bad network connection.
- Do a feature request when encounter
NotImplementedError.
Try copy-paste following code to the emulator and feel its capability:
xv = [0.5;0.2;1.0;0;0.8;0.5];
yv = [1.0;0.1;0.7;0.7;0.1;1];
xq = [0.1;0.5;0.9;0.2;0.4;0.5;0.5;0.9;0.6;0.8;0.7;0.2];
yq = [0.4;0.6;0.9;0.7;0.3;0.8;0.2;0.4;0.4;0.6;0.2;0.6];
[in,on] = inpolygon(xq,yq,xv,yv);
plot(xv,yv, ... % polygon
xq(in&~on),yq(in&~on),'r+', ... % points strictly inside
xq(on),yq(on),'k*', ... % points on edge
xq(~in),yq(~in),'bo' ... % points outside
)
The final goal of this APP is to create a serverless, Matlab compatiable console completely in end-users' browser.
First Steps
Installation
python3 -m pip install -U mat2py
or install with Poetry
poetry add mat2py
Install the translator mh_python if needed
python3 -m pip install -U mh-python
Try the example demo_fft
# download the one already converted and formatted
wget https://raw.githubusercontent.com/mat2py/mat2py/main/examples/demo_fft.py
# or convert it yourself
echo "wget https://raw.githubusercontent.com/mat2py/mat2py/main/examples/demo_fft.m"
echo "mh_python --python-alongside --format demo_fft.m"
# run it...
python3 demo_fft.py
You can also try out the online translator by modifiy the example or put your own code.
For Developer
Initialize your code
- Clone
mat2py:
git clone https://github.com/mat2py/mat2py
- If you don't have
Poetryinstalled run:
make poetry-download
source ~/.poetry/env
- Initialize poetry and install
pre-commithooks:
make install
make pre-commit-install
- Run the lint to check:
make lint
ToDO
- A serverless web service for run
.m/.pycode inside browser - Complete set of MATLAB® Basic Functions
- Copy-on-Write beheviour
- A cleaner class hierarchy
- Enable
lint(mypy, UT, etc.)
📈 Releases
You can see the list of available releases on the GitHub Releases page.
We follow Semantic Versions specification.
We use Release Drafter. As pull requests are merged, a draft release is kept up-to-date listing the changes, ready to publish when you’re ready. With the categories option, you can categorize pull requests in release notes using labels.
🛡 License
This project is licensed under the terms of the MIT license. See LICENSE for more details.
📃 Citation
@misc{mat2py,
author = {mat2py},
title = {mat2py mean to be drop-in replacement of Matlab by wrapping Numpy/Scipy/... packages.},
year = {2021},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/mat2py/mat2py}}
}
Credits 
- This project was initially generated with
python-package-template - The Matlab to Python translator
mh_pythonis developed under fork of MISS HIT, a fantastic Matlab static analysis tool. - The serverless console is created based on Pyodide.
Release files for mat2py 0.0.22
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mat2py-0.0.22.tar.gz | 49.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mat2py-0.0.22-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 111.1 kB
Release files / mat2py-0.0.22.tar.gz
| Download URL | mat2py-0.0.22.tar.gz |
|---|---|
| Size | 49.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eda39cd01a525c12e70677690f2f580aeacdfa140657c619f1fe9163b092ecf7
|
|
BLAKE2b-256 checksum How to use checksums |
ccca94526a9eb024a4e104fb6945b6c16e80358b7ca761c5dfa1244f9f82f4fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / mat2py-0.0.22-py3-none-any.whl
| Download URL | mat2py-0.0.22-py3-none-any.whl |
|---|---|
| Size | 61.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0878f95f036c6c24f01ffef1f4dc72f5058dd5de762a3431df83084ee90cb1cc
|
|
BLAKE2b-256 checksum How to use checksums |
16e8f56fac10ce93ca59ece08ee2edf9e9f7a2770bbd53afcd28e7246e116d97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|