MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   MATLAB eval()函数错误 (https://www.labfans.com/bbs/showthread.php?t=23706)

poster 2019-12-10 20:48

MATLAB eval()函数错误
 
即使使用最简单的输入,eval()也会返回相同的错误。

>> ns=int2str(17) >> xs=num2str(18) >> d = eval(ns,'+',xs) ??? Index exceeds matrix dimensions. >> eval('1/2') ??? Index exceeds matrix dimensions. 任何帮助,将不胜感激。



[B]回答:[/B]

尝试先clear all 。似乎您有一个名为eval的变量正在使函数clear all 。

>> eval = 1; >> which -all eval eval is a variable. built-in (C:\Program Files\MATLAB\R2010a\toolbox\matlab\lang\@char\eval) % Shadowed char method C:\Program Files\MATLAB\R2010a\toolbox\matlab\lang\@opaque\eval.m % Shadowed opaque method C:\Program Files\MATLAB\R2010a\toolbox\stats\@classregtree\eval.m % Shadowed classregtree method

[url=https://stackoverflow.com/questions/3273649]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 01:12

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.