數學式

2021年2月23日 星期二

Matlab批次處理excel

最近一直在用matlab,順手紀錄一下,方便未來查閱

批次讀取檔案路徑,好用的函數dir

讀寫excel的函數xlsread、xlswrite


範例

path = 'YourFolderPath';

% return all of files of the folder

Files = dir(strcat(path,'*.xlsx'));

LengthFiles = length(Files);

for i = 1:LengthFiles

%批次讀取檔案

[number, text, rawData] = xlsread(strcat(path,Files(i).name));

end


參考資料:

  1. https://www.mathworks.com/help/matlab/ref/dir.html
  2. https://www.mathworks.com/help/matlab/ref/xlswrite.html
  3. https://www.mathworks.com/help/matlab/ref/xlsread.html

沒有留言:

張貼留言

不同性別青少年非預期性單腿落地上的生物力學與能量吸收差異

青少年非預期單腿落地跳中的性別差異生物力學和能量吸收:對膝關節損傷力學的影響 Sex-specific landing biomechanics and energy absorption during unanticipated single-leg drop-jumps in...