Transfer .mat files via bluetooth

2 visualizaciones (últimos 30 días)
Rune Rasmusen
Rune Rasmusen el 8 de Jun. de 2022
Respondida: Adithya el 6 de Sept. de 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 comentario
SALAH ALRABEEI
SALAH ALRABEEI el 8 de Jun. de 2022
Why don't you use Matlab online, and get access to your stored data in Matlab drive anytime and from anywhere!

Iniciar sesión para comentar.

Respuestas (1)

Adithya
Adithya el 6 de Sept. de 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!

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by