send data from one computer to an other computer using matlab via internet.
Mostra commenti meno recenti
i want to send data from matlab to other computer that will receive data using matlab
how can i do this
If any one has idea plz comment
Risposte (5)
Ankit Desai
il 15 Apr 2011
Modificato: John Kelly
il 29 Ott 2014
1 voto
If you are using MATLAB R2011a, you can use Instrument Control Toolbox's TCPIP object as a Server Socket via the NetworkRole property. This support is for a single remote connection. You can use this connection to communicate between a client and MATLAB, or between two instances of MATLAB.
-Ankit
Walter Roberson
il 13 Apr 2011
0 voti
If you use the Instrument Control Toolbox, you can do this using udp. The Instrument Control Toolbox is, however, not able to send this data using tcp for this situation, as that toolbox does not allow MATLAB to be the "server" that connections are initiated to.
There is a MATLAB File Exchange contribution "tcpudpip" which is able to transfer data through udp or tcp; that contribution is able to have MATLAB act as a server.
1 Commento
Walter Roberson
il 29 Set 2015
Note: in the time since I wrote the above, Instrument Control Toolbox added a "server" role so it can now be done with tcp as well.
Javaid Iqbal
il 13 Apr 2011
0 voti
3 Commenti
Walter Roberson
il 13 Apr 2011
I haven't implemented this myself, but there are examples in the documentation.
Javaid Iqbal
il 14 Apr 2011
Walter Roberson
il 14 Apr 2011
Set your terminator to byte rather than a particular character.
achermen est
il 25 Apr 2011
0 voti
hi friends :)) , any one help me how to send a picture byyy socket(:'()) on a server and client matlabbb
4 Commenti
Walter Roberson
il 25 Apr 2011
See the documentation Ankit indicated. It has an example. In the example, the variable named "data" could be the raw bytes of the picture file, or it could be the image matrix you get from imread(). If you send the image matrix, be sure to send the image dimensions first so that the other end knows how to reshape the values received in to an appropriate matrix.
iup geii amiens
il 11 Giu 2014
Modificato: Walter Roberson
il 12 Mar 2017
For those looking for;how can we sent an image from a computer to another over a network using the tcpip protocole, here is the code because it can be helpful for many people. To run: run the Server session and after that the client session:
Server Session:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
close all;clear all;clc;
data =imread('out1.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 Session:
close all;clear all;clc;
tcpipClient = tcpip('172.17.94.29',30000,'NetworkRole','Client')
set(tcpipClient,'InputBufferSize',460800);
set(tcpipClient,'Timeout',30);
fopen(tcpipClient);
rawData = fread(tcpipClient,57600,'double');
fclose(tcpipClient);
reshapedData = reshape(rawData,120,160,3);
imshow(reshapedData)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Thanks a lot for those who are helping others.
Keep Going !!!!!!
iup geii amiens
il 11 Giu 2014
Ps: for those who are looking for:how can we send :P
Walter Roberson
il 12 Mar 2017
Yogesh comments to iup geii amiens:
thanks alot for your support!!
Meghashree G
il 29 Set 2015
Modificato: Walter Roberson
il 29 Set 2015
0 voti
Hi i want to send array from one matlab terminal to other! how do i do that?
Please help me
Refer the below link pls:
Thank you
Categorie
Scopri di più su Instrument Control Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!