[問題] 資料讀取已回收
我現在有一筆資料
在excel輸入
A1=test1 B1=test2 C1=test3
A2=123 B2=456 C2=789
A3=111 B3=222 C3=333
並存成csv(comma-separated values)檔,檔名為testdata
我想請問如果想讀取這個資料
因為A1,B1,C1欄位並不是數值資料,所以沒辦法用csvread
所以我嘗試用textread
程式碼是[a,b,c]=textread('testdata.csv','%d%s%d')
但是執行上出現
?? Trouble reading integer from file (row 1, field 1) ==> test1,test2,test3\n
但我並不是很懂他的涵義
我想要得到是下列結果:
a=test1 b=test2 c=test3
123 456 789
111 222 333
不知道該怎麼做??
謝謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.227.132.138
推
10/08 18:05, , 1F
10/08 18:05, 1F
→
10/08 18:06, , 2F
10/08 18:06, 2F
討論串 (同標題文章)
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章