Passing two values from one function to another in one line

I'm looking to pass the outputs of a two-output function into a two-input function, in one line.
i.e. if I have two functions
function [out1, out2] = funA(in)
%function definition here
function out = funB(in1, in2)
%function definition here
I want to do something like
out = funB(funA(in)) %this doesn't actually work
Is there syntax to do this without having to write it as
[o1, o2] = funA(in)
out = funB(o1, o2)
I'm also not looking for
[o1, o2] = funA(in); out = funB(o1, o2);

 採用された回答

Walter Roberson
Walter Roberson 2016 年 11 月 8 日

0 投票

That is not possible in MATLAB without using a auxillary function that does the assignment.

1 件のコメント

dkv
dkv 2016 年 11 月 8 日
Bummer. Thanks anyways for the answer!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

質問済み:

dkv
2016 年 11 月 8 日

コメント済み:

dkv
2016 年 11 月 8 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by