Passing two values ​​from one Matlab function to another on the same line

I want to pass the outputs of a function with two outputs to a function with two inputs on the same 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 any syntax for this without spelling it as

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

I'm not looking either

 [o1, o2] = funA(in); out = funB(o1, o2); 
+5
source share
1 answer

I'm not sure if this is possible, as if you were calling a function on a line with another call, Matlab will always assume that you only need the first / primary output.

Matlab only creates other output variables (out2 / in2 here) if you really assigned them.

0
source

Source: https://habr.com/ru/post/1259437/


All Articles