Reputation: 521
I would like to create a packet and the data load is an array. For the header I would like to create a struct because it would be easier to index its fields. For transmission, I need to concatenate both the struct and array to create a packet. How can I do it?
Upvotes: 2
Views: 179
Reputation: 20915
You should use a cell array:
a = 1:10;
b = struct('x',1,'y',2);
packet = {a, b};
Upvotes: 3