Array of structures (new)

1 view (last 30 days)
Max Müller
Max Müller on 26 Aug 2014
Answered: Michael Haderlein on 26 Aug 2014
I am new to this stuff. If i have an Array of structures like this
for i = 1:10
Data(i).x = i
Data(i).y = rand(1,1)
is there a possibility to sort Data.y part and change the related Data.x with it ? And can u pls drop some Links for more Infos about structures? Thanks

Accepted Answer

Michael Haderlein
Michael Haderlein on 26 Aug 2014
You can simply sort it and use the second output argument:
As always, there's a lot to read in the help (Matlab/Language Fundamentals/Data Types/Structures).

More Answers (0)


Find more on Structures in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by