Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.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_Function - Fatal编程技术网

在一行中将两个值从一个Matlab函数传递到另一个函数

在一行中将两个值从一个Matlab函数传递到另一个函数,matlab,function,Matlab,Function,我希望在一行中将两个输出函数的输出传递到两个输入函数 i、 如果我有两个功能 function [out1, out2] = funA(in) %function definition here function out = funB(in1, in2) %function definition here 我想做一些像 out = funB(funA(in)) %this doesn't actually work 有没有语法可以做到这一点,而不必将其写成 [o1, o2] = funA(i

我希望在一行中将两个输出函数的输出传递到两个输入函数

i、 如果我有两个功能

function [out1, out2] = funA(in)
%function definition here
function out = funB(in1, in2)
%function definition here
我想做一些像

out = funB(funA(in)) %this doesn't actually work
有没有语法可以做到这一点,而不必将其写成

[o1, o2] = funA(in)
out = funB(o1, o2)
我也不是在找你

[o1, o2] = funA(in); out = funB(o1, o2);

我不确定这是否可行,因为如果您在调用另一个函数时同时调用该函数,Matlab将始终假定您只需要第一个/主要输出


如果您实际分配了其他输出变量(此处为out2/in2),则Matlab仅创建它们。

您不能“轻松”完成此操作。您可以尝试在matlab中重新定义内容,如中所示。即使有人向您演示如何执行此操作,它也会变得模糊,而不是一种改进。我建议您继续雕刻
o1
o2
并将它们作为值传递