【问题标题】:Cannot use some Matlab MPC Toolbox functions无法使用某些 Matlab MPC Toolbox 功能
【发布时间】:2014-12-09 08:57:23
【问题描述】:

我正在尝试使用例如来自 MPC 工具箱的 setoutdist Matlab 函数(我在 Windows 8.1 上使用 Matlab R2013a)。作为回应,我收到:

    Undefined function 'setoutdist' for input arguments of type 'ss'.

我可以使用help setoutdist 获得有关此功能的帮助。当我输入函数名称和左括号时,我会收到带有参数列表的提示。当我使用which setoutdist -all 时,我收到了正确的输出:

C:\Program Files\MATLAB\R2013a\toolbox\mpc\mpc\@mpc\setoutdist.m  % mpc method code here

但即使在默认的 Matlab 路径中,该功能也不起作用,所以我认为它不会被遮蔽。 其他函数也是如此,例如setindistsetestimmpc_struct等,但mpcmpcstatempcmove函数工作正常。

我正在尝试:clear allclear classessrehash toolboxrehash pathresetrehash toolboxreset,使用 pathtool 恢复默认路径。我已经阻止了防病毒软件并将例外添加到它的列表中。我什至重新安装了我的 Matlab,没有任何帮助。

也许这很重要:当我尝试编辑 setoutdist.m 时,我收到拒绝访问的消息。

我将非常感谢任何帮助...

【问题讨论】:

    标签: matlab toolbox mpc


    【解决方案1】:

    你怎么打电话给setoutdist?正确的语法是三个之一(请参阅documentation - 对于 R2014b):

    setoutdist(MPCobj,'integrators')
    setoutdist(MPCobj,'remove',channels)
    setoutdist(MPCobj,'model',model)
    

    其中MPCobj 是模型预测控制器对象,例如使用mpc 函数创建的。从错误消息看来,您正在使用状态空间对象调用函数,这是不允许的(我猜)。

    【讨论】:

    • 愚蠢的我......我做了这样的事情:'setoutdist(MatlMPCon.MatlabMpcObject, 'model', outDistModel);' 'outDistModel' 是正确的,但我自己的类 'MatlMPCon.MatlabMpcObject' 的属性尚未初始化......无论如何,谢谢你的提示:)
    猜你喜欢
    • 1970-01-01
    • 2014-08-18
    • 2021-09-18
    • 1970-01-01
    • 2016-11-04
    • 2020-01-04
    • 2016-10-08
    • 1970-01-01
    • 2020-10-28
    相关资源
    最近更新 更多