當前位置:編程學習大全網 - 編程軟體 - matlab提取string中的特定數字

matlab提取string中的特定數字

S = REGEXP(STRING,EXPRESSION)其中EXPRESSION的取法為:        .    Any character               []    Any character contained within the brackets              [^]    Any character not contained within the brackets               \w    A word character [a-z_A-Z0-9]               \W    Not a word character [^a-z_A-Z0-9]               \d    A digit [0-9]               \D    Not a digit [^0-9]               \s    Whitespace [ \t\r\n\f\v]               \S    Not whitespace [^ \t\r\n\f\v]那麽妳的問題就可以使用下面的代碼了>>a='5000.xls'a =5000.xls>> s=a(regexp(a,'\d'))s =5000這時的s是字符型的,如果妳需要數字的話就是用str2num轉化壹下祝妳學習愉快!

  • 上一篇:東風菱智m3改裝多功能方向盤請問壹下能改嗎
  • 下一篇:有哪些手機app,可以免費看3d的模型
  • copyright 2024編程學習大全網