establish connection from python to matlab -


i trying transfer data in real time python matlab using udp protocol (as post suggested: real-time data transfer python matlab).

right have, , dosent work:

on python (sender):

import socket  my_socket= socket.socket() my_socket.connect(('127.0.0.1', 8821))  message='test1' in range(1,10):     my_socket.send(message)     print  my_socket.close 

on matlab (reciver):

u = udp('0.0.0.0','localport',8821); fopen(u);  while(1)     = fread(u,10); end  fclose(u) 

it dosent work, , errors get: python: enter image description here

and matlab:

warning: unsuccessful read:  specified amount of data  not returned within timeout period.  

any idieas?

it works me if tell socket want udp connection:

my_socket= socket.socket(socket.af_inet, socket.sock_dgram) 

(hat tip https://wiki.python.org/moin/udpcommunication)


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -