socket通信实现python调用matlab,实现零时延交互

问题描述

一次项目,Python需要调用MATLAB,在MATLAB中进行计算,并将在MATLAB中的计算结果返回给Python。网上大多都是借助于MATLAB 自带的引擎 API(matlab.engine),但单次调用或每次调用启动MATLAB耗时太长了,所以思路转向使用socket通信。

代码

Python的utils模块

from socket import *

class UdpUtils:
    def __init__(self, config):
        self.remote_addr = config[

猜你喜欢

转载自blog.csdn.net/weixin_49716548/article/details/126936584