→ celestialgod: cellfun(@(x) length(x)==4, DD) 08/25 17:35
→ celestialgod: or cellfun(@length, DD)==4 08/25 17:36
可以了耶! 原來要這樣用cellfun啊! 實在太感謝了 (跪
那如果是文中BB那種情況的話有辦法嗎??
再感謝一次!!
※ 編輯: mmcci (140.115.47.41), 08/25/2015 17:42:56
→ celestialgod: 第二個應該是regexp(BB, 'this_\d*') 08/25 17:38
C大你真的是我的大恩人
但我發現用'\d*'這樣的話會連 this_no 這種後面接字母的也找出來
所以我只用'\d',這樣就能成功找出 this_數字 的元素了
實在太感謝你啦 (再跪
※ 編輯: mmcci (140.115.47.41), 08/25/2015 17:50:04
→ celestialgod: 把*改成+就好,剛剛有想到 08/25 17:58
→ jatj: 我好像看過書 cellfun有時不會比for loop快 08/26 11:12
→ celestialgod: cellfun只是寫起來漂亮XD 08/29 01:58
推 sunev: 不用再設一個暫存迴圈變數,也不用考慮變數的size 08/29 05:54
→ celestialgod: 對,而且自動preallocate memory 08/29 10:31