[問題] 取出字串內的數字已回收

看板MATLAB作者 (明鏡止水)時間14年前 (2011/09/13 12:10), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
原始資料如下 (9430,5530): <295> local id 0, h sl ridge runout with metal. using gc uw_gc_partial_1550. strip_load_clearance 6 target ridge size 0.5, bend radius 30, n_turns == 1, length == 6000, implant_layer == -1, metal_layer == 12 Final length 12177.7 (9600,5507): <296> local id 1, h sl ridge runout with metal. using gc uw_gc_partial_1550. strip_load_clearance 6 target ridge size 0.5, bend radius 30, n_turns == 1, length == 4000, implant_layer == -1, metal_layer == 12 Final length 8177.74 這裡只列出兩筆,其實有好幾筆相同形式的資料 我想取出(9430,5530)內的9430以及5530,這是一對座標。 目前的寫法 mapfile=sprintf('map.rtf'); map=textread(mapfile, '%s', 'headerlines', 6); xy=[]; for k=3:39:432 mp=map(k); xy=[xy mp]; end; 已經將(9430,5530): (9600,5507): 陣列化 但不知道如何將字串中的9430等數字取出為獨立陣列並轉為數字 另外,似乎我的(9430,5530):被視為cell而非string 請問如何轉之成string 找了好久,請各位幫忙解答 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 76.104.192.50 ※ 編輯: murai111 來自: 76.104.192.50 (09/13 12:34)

09/13 12:52, , 1F
已經自行解決
09/13 12:52, 1F
文章代碼(AID): #1ERjVDlK (MATLAB)