Interpret string to form sequence of numbers
古いコメントを表示
I want to see if something like this already has been discussed (so I am not reinventing the wheel). Basically, I will read in a string (from a GUI) that defines a sequence of numbers, where (as an example):
temp_str = '1,2,4-9,12-20(2)';
And then, after interpreting the contents of the string, the output to the code would yield a numeric array with values:
temp_seq = [1,2,4,5,6,7,8,9,12,14,16,18,20];
Has anyone come across a thread that discusses something similar to this? If so, let me know as I would like to clean up and make my version more efficient.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!