Program made for matlab on windows doesn't work on linux. Path problem.

5 次查看(过去 30 天)
I am trying to use a program on matlab for linux, but it was made for matlab on windows.
The problem is that it tries to work with windows paths over linux.
Warning: Name is nonexistent or not a directory: /ADVISOR2002/advisor.m\saved_vehicles.
As you can see the backslash is the problem.
Any suggestion?
Regards,
Poncho

回答(1 个)

Walter Roberson
Walter Roberson 2011-9-12
Edit the program and find where it uses \ as the separator and replace it with / . The program will then be usable on both systems. To say that more explicitly: MS Windows is able to use / as the directory separator as well as the traditional Windows \
In future you can code the separator character using the result of the pathsep() function call, or you can use the fullfile() routine which will automatically use the traditional separator for the system being run on.
  5 个评论
Walter Roberson
Walter Roberson 2011-9-13
<rant>
Dang nomenclature! Those '/' or '\' characters are called path separators in POSIX! The string as a whole forms a "file path" in POSIX. TMW should have called it pathifs not pathsep !
</rant>

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by