how to use udp in matlab

1 view (last 30 days)
hamid Didari
hamid Didari on 9 Nov 2014
Commented: Geoff Hayes on 10 Nov 2014
I tried to use udp in matlab with this code :
u1 = udp('192.168.6.207', 8878, 'LocalPort', 8840);
u2 = udp('192.168.6.207', 8840, 'LocalPort', 8878);
fopen(u1);
fopen(u2);
a=[ char(240)];
fprintf(u1,a);
recStr = double(fscanf(u2));
pause(.1);
fclose(u1);
delete(u1);
clear u1;
fclose(u2);
delete(u2);
clear u2;
but I get 63 instead of 240 . how can i fix this? any idea about my problem?
Thanks Hamid
  1 Comment
Geoff Hayes
Geoff Hayes on 10 Nov 2014
Hamid - if you remove the double around
recStr = double(fscanf(u2));
and do instead
recStr = fscanf(u2);
what is recStr?

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!