Transferring data between two computers by mouse clicking a pushbutton using MATLAB GUI
2 ビュー (過去 30 日間)
古いコメントを表示
Maurice Rohracker
2017 年 3 月 23 日
回答済み: Anoop Somashekar
2017 年 3 月 31 日
Hi I want to transfer data consitantly by mouse clicking a pushbutton in MATLAB GUI. Therefor I created a server (Server.m) and a client function (Verbraucher.m). The client function should open when the data is available and the server function has to open and close all secenonds, because in the same code is again a live-plot in a MATLAB GUI. But for some reasons the code doesn't work. Although I transfered data between two computers using the Server and Verbraucher file manually. For better understanding a added the functions and files.
2 件のコメント
Geoff Hayes
2017 年 3 月 24 日
Maurice - can you clarify what you mean but the code doesn't work. Which portion of the code is failing? Transferring the data from one machine to another? Updating the live plot?
If you are observing any errors, please copy and paste the full error message to this question.
採用された回答
Anoop Somashekar
2017 年 3 月 31 日
I ran the attached code and was able to send /receive the data between client and server. I was also able to recreate the error 'SIZE must be greater than 0' by passing an empty vector to the function Verbraucher i.e. Verbraucher([]). Since an empty vector is also a double, the BytesAvailable property at the server side will be greater than zero. You could add an extra check before performing an 'fread' as shown below:
if elements > 0
data = fread(reader,elements,'double');
end
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!