I have a Matlab struct:
a(1).x=54.23; a(1).y=2.3; a(1).col=32.221; a(1).id=1;
a(2).x=5.23; a(2).y=3.3; a(2).col=2.221; a(2).id=2;
... and so on. Now i want to access the struct in a
having id 73. I can think of doing a for loop but the thing is i have to access elements of array a
several times like this based on id. Wat is the fastest data structure available for this purpose? Python like dictionary may work but i am not sure ow to implement it. Pointing out some code examples would be very helpful.