sending and receiving data in matlab by an UDP object - Programmers Heaven

Howdy, Stranger!

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

Categories

sending and receiving data in matlab by an UDP object

pckongpckong Posts: 1Member
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 192.168.0.100 (not static IP)
For PC2 (client) the IP address is 192.168.0.223 (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('192.168.0.223', 9090);
fopen(u)
fwrite(u, 1:10);
fclose(u)

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

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,

Peter

Comments

  • vb2kvb2k Posts: 1Member
    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.

    Thanks
    Vaibhav
Sign In or Register to comment.