[討論] 如何讀取 excel 中 多個sheet的 同一個

看板MATLAB作者 (( ・ω・`))時間5年前 (2018/12/12 22:46), 5年前編輯推噓1(104)
留言5則, 1人參與, 5年前最新討論串1/1
如題 目前手邊有一個excel raw data Excel內部有多個sheet 且每個sheet都有裝資料 請問一下如何利用loop迴圈 將每一個sheet中固定儲存格讀取 且儲存成vector or array ? Ex:假設每個sheet都是A1這個儲存格的data要取出來 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 27.247.225.215 ※ 文章網址: https://www.ptt.cc/bbs/MATLAB/M.1544625979.A.AFE.html

12/13 23:50, 5年前 , 1F
假設檔名叫QQQ.xlsx,共10個sheet
12/13 23:50, 1F

12/13 23:51, 5年前 , 2F
for i = 1:10
12/13 23:51, 2F

12/13 23:51, 5年前 , 3F
data(i) = xlsread('QQQ.xlsx',i,'a1')
12/13 23:51, 3F

12/13 23:51, 5年前 , 4F
plot((1:10),data)
12/13 23:51, 4F

12/13 23:52, 5年前 , 5F
抱歉 plot前要加一個end
12/13 23:52, 5F
感謝大大 我研究一下 ※ 編輯: amateuruser (39.8.165.144), 12/14/2018 00:28:11 請問一下l大 我試了一下 好像還是有誤耶 In an assignment A(:) = B, the number of elements in A and B must be the same. 顯示是這樣的 ※ 編輯: amateuruser (39.8.165.144), 12/14/2018 00:34:46 剛才又改了一下 clear; for i=1:10; data(:,i)=xlsread('test.xlsx',i,'A1'); end; 不過錯誤變成這個: Assignment has more non-singleton rhs dimensions than non-singleton subscripts ※ 編輯: amateuruser (39.8.165.144), 12/14/2018 00:42:19
文章代碼(AID): #1S4Hyxh- (MATLAB)