Matlab无法在内部代码中部署 [英] matlab fails deployment in internal code

查看:131
本文介绍了Matlab无法在内部代码中部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编译一个gui matlab项目,但由于此错误而失败,这不在我的代码中

I want to compile a gui matlab project, but fail because of this error which is not in my code

Subscript indices must either be real positive integers or logicals.

Error in isscript (line 7)
        if strcmpi(pth(end-1:end), '.m') && exist(pth, 'file') == 2

Error in matlab.depfun.internal.Schema/move/@(setMembers)setMembers(~isscript(setMembers))


Error in matlab.depfun.internal.Schema>applyMoveFcn (line 987)
    keptFiles = fcn(fileList);

Error in matlab.depfun.internal.Schema>@(files,destMap)applyMoveFcn(op,files,destMap,destSet,reason,rule) (line 822)
                    @(files, destMap)applyMoveFcn(op, files, destMap, ...

Error in matlab.depfun.internal.Schema/applySetRules (line 141)
                        xformedSet = feval(operations{n}, xformedSet, rMap);

Error in matlab.depfun.internal.Completion/applySetRules (line 1059)
            [modifiedList, rMap] = ...

Error in matlab.depfun.internal.Completion/initializeRootSet (line 1142)
            [addedFiles, ruleFilter, notes] = ...

Error in matlab.depfun.internal.Completion (line 1601)
                obj.RootSet = initializeRootSet(obj, files);

Error in matlab.depfun.internal.requirements (line 166)
    c = matlab.depfun.internal.Completion(files, tgt);

Error in appcreate.internal.appbuilder.getDependencyList (line 173)
            [dependentfiles, depproducts, ~] = matlab.depfun.internal.requirements(varargin, 'MATLAB');

我如何获得Matlab(2013b)来编译程序包?

How can I get matlab (2013b) to compile the package?

matlab失败的代码是(不是我的代码)

The code where matlab fails is (which is NOT my code)

function tf = isscript(files)
% ISSCRIPT Is the file a script file?
tf = false(1,numel(files));
for k=1:numel(files)
    pth = files{k};
    % Can't be a script if it isn't an M-file.
    if strcmpi(pth(end-1:end), '.m') && exist(pth, 'file') == 2 
        mt = matlab.depfun.internal.cacheMtree(pth);
        fcn = mtfind(mt, 'Kind', 'FUNCTION');
        tf(k) = isempty(fcn);
    end
end

推荐答案

文件名长度为1的文件的代码将失败.或者使用如此短的文件名重命名所有文件,或者将行更改为:

The code will fail for files with a filename of length 1. Either rename all files with such a short filename or change the line to:

if length(pth)>1 && strcmpi(pth(end-1:end), '.m') && exist(pth, 'file') == 2 

这篇关于Matlab无法在内部代码中部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆