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