本文共 527 字,大约阅读时间需要 1 分钟。
代码备份自用的,可参考movefile 函数
clear clc cd('C:\EO');%设置当前目录:current directory for i = 1 : 47 folderName{i} = ['sub_', num2str(i)]; mkdir(folderName{i}); % 新建一个文件夹 end eval(['load ',prefix_common,'_ec_fft_stsp_sub_',num2str(i,'%03d'),'.mat;']);a='C:\EO';b='C:\EO';for k = 24:47% b=num2str(k,'%3d');% a=[sourcePath,'\','N_EC_1_Sub_',num2str(k,'%03d'),'.nii']; targetPath=[a,'\','sub_',num2str(k,'%01d')]; sourcePath=[b,'\','N_EO_Sub_',num2str(k+1,'%03d'),'.nii']; movefile(sourcePath,targetPath);end
转载地址:http://famen.baihongyu.com/