matlab 获取当前文件所在路径的上一级路径
来源:互联网 发布:js延时函数sleep 编辑:程序博客网 时间:2024/05/29 21:16
used functions:
mfilename(): name of the current m-file
fileparts(): get the path string part
filesep: '/' or '\'
strfind(): find a substring from an objective string
code:
currentDepth = 1; % get the supper path of the current path
currPath = fileparts(mfilename('fullpath'));% get current path
fsep = filesep;
pos_v = strfind(currPath,fsep);
p = currPath(1:pos_v(length(pos_v)-currentDepth+1)-1); % -1: delete the last character '/' or '\'
mfilename(): name of the current m-file
fileparts(): get the path string part
filesep: '/' or '\'
strfind(): find a substring from an objective string
code:
currentDepth = 1; % get the supper path of the current path
currPath = fileparts(mfilename('fullpath'));% get current path
fsep = filesep;
pos_v = strfind(currPath,fsep);
p = currPath(1:pos_v(length(pos_v)-currentDepth+1)-1); % -1: delete the last character '/' or '\'
- matlab 获取当前文件所在路径的上一级路径
- 获取当前文件所在路径
- PHP获取当前文件所在路径
- Python获取当前文件所在路径
- java获取当前class文件所在路径
- 获取当前文件程序所在的物理路径
- JS获取当前文件所在的文件夹全路径
- C#获取当前应用程序所在的路径
- C#获取当前应用程序所在的路径
- C#获取当前应用程序所在的路径
- 获取当前应用程序所在目录的路径
- C#获取当前应用程序所在的路径
- C#获取当前应用程序所在的路径
- C#获取当前应用程序所在的路径
- 获取当前程序可执行文件的所在路径
- Magento 获取当前分类图片路径(如果当前分类没有图片,就获取上一级分类的图片路径)
- 获取当前模块所在路径
- 获取当前DLL所在路径
- 莫西的伤感情侣日志推荐:分手的那一刻,我们变得陌生
- 英语练习105 Turn right
- asp.net 在网页上签入pdf阅读器,不能打开文件名是中文的文件
- Android onKeyDown
- lua c++ (一)
- matlab 获取当前文件所在路径的上一级路径
- 在UINavigationController下的-(void)viewWillAppear:方法失效的解决办法
- Android ANR问题的解决
- RAD(Rational Application Develop,快速应用开发)模型
- net导入和导出
- jQuery 选择器
- CAS单点登录
- hibernate merge和saveOrUpdate方法
- A potentially dangerous Request.Path value was detected from the client 异常