フィルターのクリア

Sort a vector of <1x1 struct>

2 ビュー (過去 30 日間)
Stephen Molnar
Stephen Molnar 2012 年 5 月 9 日
I have a vector of <1x1 struct> each structure contains an element containing five sequential times. I would like to sort the vector by the first time in each individual <1x1 struct>.
Thanks in advance.

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 5 月 9 日
Assuming that the 5 times are a row vector:
[sortedtimes, idx] = sort(min(vertcat(YourStruct.Element),2));
NewStruct = YourStruct(idx);

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by