matlab目录操作

f=fullfile('D:','Matlab','example.txt'); %获取置顶目录内的所有文件的信息
[pathstr,name,ext,versn]=fileparts(f);  %将文件信息拆分为各个部分
exist(f);
which abs(0);
p='D:\Matlab';
f=fullfile(p,'example.txt');
isp=isdir(p);<pre code_snippet_id="343353" snippet_file_name="blog_20140513_1_7201117" name="code" class="plain">f=fullfile('D:','Matlab','example.txt');
[pathstr,name,ext,versn]=fileparts(f);
exist(f);
which abs(0);
p='D:\Matlab';
f=fullfile(p,'example.txt');
isp=isdir(p);
isp=isdir(f);
files=dir(p);
cd('D:/matlab');
pwd %获取当前目录
path 
path(‘newpath’)
path(path,’newpath’) 
path(’newpath’, path)
addpath(‘directory’) %添加matlab的默认目录
rmpath
what
what(‘dirname’)
mkdir('dirname') %新建文件夹

isp=isdir(f);files=dir(p);cd('D:/matlab');pwdpathpath(‘newpath’)path(path,’newpath’) path(’newpath’, path)addpath(‘directory’)rmpathwhatwhat(‘dirname’)
 
 
 

你可能感兴趣的:(matlab)