sending and receiving data in matlab by an UDP object

Hi all,

I am doing school project and am getting desperate at this moment. I hope in somewhere you will be able to give me some hints, as soon as possible.

Here is what I got. I need to send data from a PC to the other, they are both running matlab. The data transmission will be done with two sets of wireless network card.

I intended to set the data transmission done in a UDP object. Before I made the attempt, an ad-hoc network has been set up, and it is tested working. Here is some useful network information,
For PC1 (host) the IP address is (not static IP)
For PC2 (client) the IP address is (not static IP)

I made a simple test to try sending data with matlab via port 9090, here is what I did,
In PC1, I try to write an integer array to the client port
u=udp('', 9090);
fwrite(u, 1:10);

In PC2, I try to read the integer array from its port
u=udp('', 9090);
A=fread(u, 10);

But no matter how I try, I cannot retrieve the data. I cannot switch to do the whole network programming in Linux as it is too late for me, and I cannot do it in winsock either as I have written a whole bunch of other programs in matlab already.

Please help.

Yours Sincerely,



  • Hello Peter,

    So.. were you successful in your task of data transmission by UDP.

    I am also in a similar position..

    Could you plz share your experience.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion