Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
高级会员
注册日期: 2019-11-21
帖子: 3,006
声望力: 66 ![]() |
![]()
我正在Windows下运行Matlab 7.8.0。
我正在使用dos()调用外部实用程序,该实用程序会在当前目录中创建一个文件。我已经正确创建了文件,但是exist或fopen无法看到它,它们分别返回0和-1 。文件名正确! >> pwd ans = I:\ >> ls file1.asc file2.asc file3.asc >> exist('file1.asc') % this file was there before ans = 2 >> exist('file2.asc') % this file is newly created ans = 0 为了确认它不是奇数/问题文件名,我从Cygwin shell中进行了检查: /cygdrive/i/ $ if [ -f file2.asc ]; then echo "OK"; fi OK 因此文件很好。我试图重命名 /cygdrive/i/ $ mv file2.asc test 在Matlab中 >> ls file1.asc file3.asc test >> exist('test') ans = 0 如果我退出并重新启动Matlab,它可以正常工作。但是我需要动态创建文件然后访问它! 回答: 很神秘 您可以尝试:
更多&回答... |
![]() |
![]() |