matlab转python

本文最后更新于 2023年9月25日。

5 Ways To Convert Matlab To Python

https://www.pythonpool.com/convert-matlab-to-python/

https://github.com/ebranlard/matlab2python

python日志loging
https://juejin.cn/post/6966998948531666981

python conda安装第三方包时提示

The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

解决办法时新建一个虚拟环境再安装。

230224转换了一下试试,

加载个人及系统配置文件用了 1532 毫秒。
(base) PS C:\Users\weiyo> conda activate env_m2py
(env_m2py) PS C:\Users\weiyo> python E:\mydoc\sync_pc_home_work\pyfile\matlab2python-main\matlab2python.py chg2numzero_230131.m -o chg2numzero_230131.py
Traceback (most recent call last):
File "E:\mydoc\sync_pc_home_work\pyfile\matlab2python-main\matlab2python.py", line 47, in <module>
main(sys.argv[1:])
File "E:\mydoc\sync_pc_home_work\pyfile\matlab2python-main\matlab2python.py", line 42, in main
mpars.matlab2python(opts.filelist, **opts_dict)
File "E:\mydoc\sync_pc_home_work\pyfile\matlab2python-main\matlabparser\parser.py", line 501, in matlab2python
matlab2python(f, output=output, backend=backend, **kwargs)
File "E:\mydoc\sync_pc_home_work\pyfile\matlab2python-main\matlabparser\parser.py", line 504, in matlab2python
raise Exception('FileNotFound:'+filename)
Exception: FileNotFound:chg2numzero_230131.m
(env_m2py) PS C:\Users\weiyo> cd C:\Users\weiyo\Documents\test230224
(env_m2py) PS C:\Users\weiyo\Documents\test230224> python E:\mydoc\sync_pc_home_work\pyfile\matlab2python-main\matlab2python.py chg2numzero_230131.m -o chg2numzero_230131.py
np.arange(1,100+1),:
<class 'smop.node.expr_list'>
(env_m2py) PS C:\Users\weiyo\Documents\test230224>