【问题标题】:Output file not generated in Matlab after compilingMatlab编译后未生成输出文件
【发布时间】:2015-10-14 19:56:56
【问题描述】:

我的 Matlab GUI 文件中有以下代码

    fileID = fopen('Game.txt','w');
    fileattrib('Game.txt','+w');
    fprintf(fileID,'%s %d ', 'You played level', handles.game_level);
    fprintf(fileID,'%s %d %s', 'and it took you', UserTries, 'tries');
    fileattrib('Game.txt','-w');
    fclose(fileID);

我使用“deploytool”命令使用 Matlab 生成可执行文件。但是当我执行生成的可执行文件时,此过程不会生成 Game.txt 文件。有什么建议吗?

【问题讨论】:

    标签: matlab compilation output executable


    【解决方案1】:

    我猜它确实存在,但不是您期望的位置。 我猜你会在提取 ctf 的目录中找到它。默认是在临时文件夹下面的某个位置。 ctfroot() 命令会告诉你它的确切位置。 为了克服这个问题,在一些绝对路径中创建你的文件,比如 c:\game.txt

    【讨论】:

      猜你喜欢
      • 2014-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-04
      • 2013-09-05
      • 2017-09-15
      相关资源
      最近更新 更多