Transfer .mat files via bluetooth

2 views (last 30 days)
Rune Rasmusen
Rune Rasmusen on 8 Jun 2022
Answered: Adithya on 6 Sep 2023
Dear all,
I'm looking for a solution for transfering a .mat file from one PC to another via bluetooth (if possible). The .mat file contains a cell array. However, from the documentation it seems that data can only be of a 1-by-N numeric array. Is there a workaround for this? Or should I look for an alternative way of transferring the .mat files between my two PCs, like TCP/IP or UDP?
Thanks!
  1 Comment
SALAH ALRABEEI
SALAH ALRABEEI on 8 Jun 2022
Why don't you use Matlab online, and get access to your stored data in Matlab drive anytime and from anywhere!

Sign in to comment.

Answers (1)

Adithya
Adithya on 6 Sep 2023
Hello @Rune Rasmusen, I understand from your question that you’re seeking a solution to transfer a .mat file containing a cell array from one PC to another using Bluetooth.
You are correct that the documentation specifies that the data can only be a 1-by-N numeric array when using the Bluetooth function in MATLAB. Therefore, a workaround is needed to transfer the cell array.
One alternative solution is to use TCP/IP or UDP communication for transferring the .mat file between your two PCs. MATLAB provides functions such as tcpip and udp that allow you to establish network connections and transfer data.
Here's a general outline of the steps you can follow:
1. Set up a TCP/IP or UDP connection between the two PCs. One PC acts as the server and the other as the client.
2. Serialize the cell array into a suitable format for transmission. You can use functions like matfile or save to save the cell array to a temporary file on the sender side.
3. Transfer the serialized file over the established network connection using appropriate functions like fwrite and fread for TCP/IP or udpwrite and udpread for UDP.
4. On the receiver side, deserialize the received file back into a cell array using functions like load or matfile.
By using TCP/IP or UDP communication, you can transfer the .mat file, including the cell array, between the two PCs. This approach allows you to overcome the limitation of the Bluetooth function.
Please note that implementing network communication involves additional considerations such as IP addresses, port numbers, and error handling.
I hope this helps you. Let me know if you have any further questions!

Categories

Find more on Data Import and Analysis in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!