some useful techniques of matlab (updating)/一些matlab有用的技巧(更新中)

  1. Find all the .m files in the current folder and its subfolder(s).
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    subdir=genpath('.'); 
    filedir=regexp(subdir,pathsep, 'split'); %Split the char list into several cells, which contain the paths of every subfolder

    for i = 1:length(filedir)-1
    data_fn=dir([filedir{i},'*.m']); %Find the .m files in every subfolder
    for j = 1:length(data_fn)
    path = [filedir{i},'',data_fn(j).name]; % Find the path of every .m file

    % Your processing code for every .m file should be here.

    end
    end

Reference:
2019世界机器人大赛—BCI脑控机器人大赛 暨 第三届中国脑机接口大赛,matlab范例代码