Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 在函数输出中传递多个函数句柄_Matlab - Fatal编程技术网

Matlab 在函数输出中传递多个函数句柄

Matlab 在函数输出中传递多个函数句柄,matlab,Matlab,我有一个m-file函数,我想用这个文件将2个函数句柄和6个浮点数传递给主文件。我试图将所有8个元素都包含到一个数组中,并从m-file函数输出,但这不起作用。有什么方法可以做到这一点吗?您可以创建函数句柄数组或双精度数组,但要创建既包含函数句柄又包含双精度数组,需要使用 不建议使用函数句柄数组,因为索引和调用之间存在歧义-事实上,最新版本的MATLAB甚至不允许将函数句柄连接到数组中,如 function output = myFunction(someInput) %# create ha

我有一个m-file函数,我想用这个文件将2个函数句柄和6个浮点数传递给主文件。我试图将所有8个元素都包含到一个数组中,并从m-file函数输出,但这不起作用。有什么方法可以做到这一点吗?

您可以创建函数句柄数组或双精度数组,但要创建既包含函数句柄又包含双精度数组,需要使用


不建议使用函数句柄数组,因为索引和调用之间存在歧义-事实上,最新版本的MATLAB甚至不允许将函数句柄连接到数组中,如
function output = myFunction(someInput)

%# create handle1, handle2, numbers 1-6
%# ...

%# assemble output:
%# output{1} contains the first handle
%# output{3} contains the first number
%# output{6} contains an array of numbers 4 through 6
output = {handle1, handle2, number1, number2, number3, [number4, number5, number6]};