文字列の中から、”(”に対応した")"を探す
Mostrar comentarios más antiguos
下記のような括弧を含む文字列があるとします。
文字列に含まれる"("に対応した")"が何文字目にあるかを調べたい場合、どのようにすれば良いでしょうか
text = "3*(A+(B+2))+5*(C+4)";
下記のように”(”が登場する位置と、対応する")"の位置を出力したいです。
ans =
3,11
6,10
15,19
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre 文字と文字列 en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!