I need to access to a structure that is inside a structure: I have a main structure called GlobalStruc that has many items (my "packets"). Each packets contains many info, i.e. has many fields. One of which is itself a structure with several fields. I need to have access to each of these fields. Any idea?
To sum up: GlobalStruc.DetailsStruc which contains many fields and has many indexes. How can I have access to these? If more convinient, can I create an array with these fields? Something like CharacteristicOfThePacket = GlobalStruc(index).DetailsStruc.FieldThatIWant
Here is an example of how the main structure was built: `
GlobalStruc(1).data1 = 1; GlobalStruc(1).data2 = 12; GlobalStruc(1).moredata.velocity = 327; GlobalStruc(1).moredata.bbeta = 3.2; GlobalStruc(2).data1 = 23; GlobalStruc(2).data2 = 56; GlobalStruc(2).moredata.velocity = 442; GlobalStruc(2).moredata.bbeta = 1.7; GlobalStruc(3).data1 = 4.3; GlobalStruc(3).data2 = 7; GlobalStruc(3).moredata.velocity = 556; GlobalStruc(3).moredata.bbeta = 1.1;
` Now I wish I could say:
myVelocities=GlobalStruc(:).moredata.velocity;
But I get this error :
Expected one output from a curly brace or dot indexing expression,
but there were 3 results.
Thank you so much,