我想从iPython笔记本运行MATLAB代码。
我安装了以下库:
我正在尝试将MATLAB与iPython连接,以便使用以下代码运行MATLAB命令:
import sys
sys.path.append('C:\Python27\Lib\site-packages\pymatbridge')
from pymatbridge import Matlab
mlab = Matlab()
mlab = Matlab(executable='C:\Program Files\MATLAB\R2013a\bin\matlab')
mlab.start()
但是,获得了以下信息:
Starting MATLAB on ZMQ socket tcp://127.0.0.1:42987
Send 'exit' command to kill the server
............................................................MATLAB session timed out after 60 seconds
当运行%load_ext pymatbridge
时,iPython-magic命令返回:
The pymatbridge module is not an IPython extension.
你能帮忙吗?
答案 0 :(得分:0)
% MATLAB script to setup ZeroMQ-MATLAB session ( neutral agent-to-agent PUB/SUB )
clear all;
if ~ispc
s1 = zmq( 'subscribe', 'ipc', 'MATLAB' ); %% using IPC transport on <localhost>
else
disp( '0MQ IPC not supported on windows. Setup TCP transport class instead' )
disp( 'Setting up TCP' )
s1 = zmq( 'subscribe', 'tcp', 'localhost', 5555 );
end
recv_data1 = []; %% setup RECV buffer
more details >>> Most efficient way to exchange data between MATLAB and ...?