gmr 通信 matlab,matlab使用TCP/IP Server Sockets
server 與 client 通信:(image)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% server
close all;clear all;clc;
data =imread('img.jpg');
data=im2double(data);
s = whos('data')
s.size
s.bytes
tcpipServer = tcpip('0.0.0.0',30000,'NetworkRole','Server');
set(tcpipServer,'OutputBufferSize',s.bytes);
fopen(tcpipServer);
fwrite(tcpipServer,data(:),'double');
fclose(tcpipServer);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% client
close all;clear all;clc;
tcpipClient = tcpip('127.0.0.1',30000,'NetworkRole','Client')
set(tcpipClient,'InputBufferSize',4500000);
set(tcpipClient,'Timeout',30);
fopen(tcpipClient);
rawData = fread(tcpipClient,562500,'double');
fclose(tcpipClient);
reshapedData = reshape(rawData,375,500,3);
imshow(reshapedData)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
matlab借助java類,實現server 與 client 通信:
總結
以上是生活随笔為你收集整理的gmr 通信 matlab,matlab使用TCP/IP Server Sockets的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php oauth api,PHP实现人
- 下一篇: matlab中rsa,matlab -