I am working on an Arduino project where I have to send values for time, position, and measurement data frequently to Matlab for post-processing. Is there any way I can send them all as one object (like a packet) and have Matlab pick it up? I know how to send one measurement at a time, but I couldn't find anything that would allow me send a few different values all at once.
I'm pretty new to this so I really appreciate your guidance and patience!
Sure just Serial.print them one after another. Serial data only goes out one byte at a time. The concept of a packet is an agreement between the sender and receiver. The receiver relies on the fact that the sender will send all of some set of particular things in some order. Then we call it a data packet. It's nothing special about how the data is formatted, just that the sender and receiver have agreed on some format. Since you are writing the code on both ends, you get to decide, for example, does the temperature come first or the pressure and then write the receiving code to expect things in that order.