Skip to content

Instantly share code, notes, and snippets.

@hibetterheyj
Last active January 24, 2019 13:59
Show Gist options
  • Save hibetterheyj/f0ab3f5ce6bbeba315b555eeeba40a71 to your computer and use it in GitHub Desktop.
Save hibetterheyj/f0ab3f5ce6bbeba315b555eeeba40a71 to your computer and use it in GitHub Desktop.
replace dir path with uniform style (matlab)
% process path to make sure it's uniform
% ispc() 用于判定在win系统下运行,把他改成标准化的'/'
% streep()可以用于替换单个str元素或者cell array中的str
if ispc(), base_path = strrep(base_path, '\', '/'); end
% 在行末补上一个/
if base_path(end) ~= '/', base_path(end+1) = '/'; end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment