Matlab:复制同级文件夹中的文件到当前文件夹
dirpath = fileparts(mfilename('fullpath')); % 获取当前脚本所在路径 sourceDir = fullfile(dirpath, '..\OtherFolder'); % 源文件夹路径 destDir = fullfile(dirpath, 'MyFolder'); % 目标文件夹路径 copyfile(fullfile(sourceDir, '1.txt'), destDir); % 复制'1.txt'文件到目标文件夹
原文地址: https://www.cveoy.top/t/topic/mCtz 著作权归作者所有。请勿转载和采集!