文字列の中から、”(”に対応した")"を探す
Afficher commentaires plus anciens
下記のような括弧を含む文字列があるとします。
文字列に含まれる"("に対応した")"が何文字目にあるかを調べたい場合、どのようにすれば良いでしょうか
text = "3*(A+(B+2))+5*(C+4)";
下記のように”(”が登場する位置と、対応する")"の位置を出力したいです。
ans =
3,11
6,10
15,19
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur 文字と文字列 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!