How to set UDP communication in Matlab applications?

4 views (last 30 days)
Hello everyone! I am trying to create two Matlab applications using appdesigner. First one should have TextArea and Button, and when Button is pushed, text from TextArea should be sent to another app and be shown in another app's TextArea. Communication between two apps should be done using udpport. That is the problem I can't solve. Can anyone help me? Be free to attach your solutions! (I am using R2024b, and applications should be on one machine)

Answers (1)

Walter Roberson
Walter Roberson on 20 Dec 2024
%first application
system('matlab -batch SecondApplication() &');
pause(10);
u = udpport();
write(u, 1:5, "uint8", "127.0.0.1", 43219);
%second application
u = udpport(LocalPort=43219);
data = read(u, 5, "uint8");

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!