MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB混合编程] 函数调用问题 (https://www.labfans.com/bbs/showthread.php?t=20533)

angelguomin 2013-12-13 22:50

函数调用问题
 
matlab调用函数返回值为一个数,函数中包含矩阵,函数返回值为矩阵所有元素之和,函数中不直接含有变量,而矩阵是用变量x(i)求出来的,不知道matlab可不可以写这种程序,求指教!!!

如function y=fun(x)

y=sum(sum(A))

其中A是用随机生成的x(i)计算出来的


这问题程序该怎么写,急求!!!!


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

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