Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Sorting a string only using a partial part by the use of another predetermined string order

3 ビュー (過去 30 日間)
Justin Brangiforte
Justin Brangiforte 2022 年 3 月 21 日
閉鎖済み: Stephen23 2022 年 3 月 21 日
So I have theses 2 arrays below where array A is the desired order and I would like to have array B placed in the same order. I have tried FEX nat_sort, ismember, and other pattern sorting techniques that I have come up with on my own but to no avail I have figured out how to sort these the same. Where before the colon is the only thing that matches string A and the array strings will always have equivalent entries, and will NEVER have duplicate entries.
A = "FLOATING.NET.P2" "PDSTL" "POLY1.1" "POLY1.5" "CONT.1" "ANCH.4" "MET.3" "BEAMS.3" "GERING.1" "GERING.2" "CAVE.3";
B = ["ANCH.4:text here";"BEAMS.3:text here";"CAVE.3:text here";"CONT.1:text here";"FLOATING.NET.P2:text here";"GERING.1:text here";"GERING.2:text here";"MET.3:text here";"PDSTL:text here";"POLY1.1:text here";"POLY1.5:text here"];
  2 件のコメント
Justin Brangiforte
Justin Brangiforte 2022 年 3 月 21 日
I DON'T want to extract before the colon and sort but I want to sort the entire string just using partial matches

回答 (0 件)

この質問は閉じられています。

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by