MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB基础] 请教feval函数的用法 (https://www.labfans.com/bbs/showthread.php?t=13636)

daydayup2 2011-06-29 09:19

请教feval函数的用法
 
想在一个函数例程中运行另一个函数,
out = main_fun('another_function',x)
请问如何让main_fun内部执行
another_function(another_variable)?

我在main_fun中用
y=feval(@funk,another_variable);
在matlab6.1下出现错误Undefined function 'funk'.
在matlab2008下出现错误:
"funk" was previously used as a variable,
conflicting with its use here as the name of a function or command.
See MATLAB Programming, "How MATLAB Recognizes Function Calls That Use Command Syntax" for details.
请问该如何修改语句y=feval(@funk,another_variable);?
先谢了!


所有时间均为北京时间。现在的时间是 14:19

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