matlab_wrapper

Easy to use MATLAB wrapper for Python
授权协议 GPL-3.0 License
开发语言
所属分类 应用工具、 科研计算工具
软件类型 开源软件
地区 不详
投 递 者 曾泳
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

matlab_wrapper

With matlab_wrapper you can easily talk to MATLAB from your Pythonscripts and an interactive shell. MATLAB session is started in thebackground and appears as a regular Python object.

Info: matlab_wrapper is maintained, but not actively developed.

Usage

Initialize:

import matlab_wrapper
matlab = matlab_wrapper.MatlabSession()

Low level:

matlab.put('a', 12.3)
matlab.eval('b = a * 2')
b = matlab.get('b')

Workspace:

s = matlab.workspace.sin([0.1, 0.2, 0.3])

sorted,idx = matlab.workspace.sort([3,1,2], nout=2)

matlab.workspace.a = 12.3
b = matlab.workspace.b

More examples are in the examples directory!

Features

  • Access MATLAB variables and functions from Python
  • Multiplatform: GNU/Linux, Windows, OS X
  • On-the-fly conversion between MATLAB and Numpy data types
  • Support for MATLAB's numerical, logical, struct, and cell arrays
  • Pure Python, no need to compile anything (matlab_wrapper talks toMATLAB engine library using ctypes)

For a complete list of changes including new features, check theNEWS.rst file.

Installation

First, make sure that you have the following components installed:

  • Python 2.7
  • MATLAB (various versions)
  • Numpy

Next, install matlab_wrapper using pip (the standard Python packageinstallation tool) from your command line:

pip install matlab_wrapper

Contribute

Check our CONTRIBUTING guidelines.

Support

If you are having issues, please let me know through the issuetracker: https://github.com/mrkrd/matlab_wrapper/issues. Try to avoidduplicates by searching previous issues, checking FAQ, andCONTRIBUTING.

Acknowledgments

matlab_wrapper was forked from pymatlab.

MATLAB is a registered trademark of The MathWorks, Inc.

License

The project is licensed under the GNU General Public License v3 orlater (GPLv3+).

  • #!/usr/bin/python #-*-coding:utf-8-*- import matlab.engine import datetime from gradientdescent import gd import models.arima_matlab import models.narxnet_matlab def hour_predict_up(cellid, turnid, cu

  • gtsam-matlab环境配置 在matlab中安装gtsam工具箱主要参考这牌篇博客,我记录了几个实际遇到的问题 matlab使用gtsam工具箱:https://blog.csdn.net/subiluo/article/details/120034253 注意使用较高版本gtsam的cmake参数-DMATLAB_ROOT应改为-DMatlab_ROOT_DIR gtsam的版本不宜过高,

  • Blob Code .........\Blob Code .........\.........\GetCentriods.m .........\.........\GetFeatures.m .........\.........\GetGroundDistancesPCA.m .........\.........\HOGGradient.m .........\.........\Img

  • 先把matlab下载好。按照其他博客安装都默认安装到python2.7了,只有这篇能够python3.6 3.5 2.7 都能安装上,神奇。 我是ubuntu16.04+matlab2018b。 https://blog.csdn.net/william_hehe/article/details/82828873    

  • function H = fhog( I, binSize, nOrients, clip, crop ) % Efficiently compute Felzenszwalb's HOG (FHOG) features. % % A fast implementation of the HOG variant used by Felzenszwalb et al. % in their work

  • make Building wrappers ... Building with 'g++'. Error using mex /home/fupeng/workspace/libelas-master/matlab/elasMex.cpp: In function ‘void mexFunction(int, mxArray**, int, const mxArray**)’: /home/fu

  • matlab中使用mex编译c语言文件报错提示: undefined reference to __imp_WSAStartup' 最近我在做一个simulink和其他仿真软件的联合仿真,需要用到udp或者tcp/ip通讯,由于我之前没有学m语言,但是对于c语言比较熟悉,于是就想用c语言写一个tcp/ip的服务器,嵌入到simulink里调用仿真,具体的simulink嵌入c语言见此处,但是在使用