Second output argument as input argument

2 次查看(过去 30 天)
Is it possible to combine the two lines:
[~,b] = myfunction(x);
c = myfunction2(b);
Something like: c = myfunction2(myfunction(x){2}) ??

采纳的回答

Walter Roberson
Walter Roberson 2012-1-30
There is no MATLAB syntax or built-in function that supports what you want to do, unfortunately.
  1 个评论
Daniel Shub
Daniel Shub 2012-1-30
See: http://www.mathworks.com/matlabcentral/answers/1325-what-is-missing-from-matlab#answer_1931

请先登录,再进行评论。

更多回答(1 个)

Andrei Bobrov
Andrei Bobrov 2012-1-30
create function myfunctionMore:
function out = myfunctionMore(x)
[~,out] = myfunction(x);
and below
c = myfunction2(out);
c = myfunction2(myfunctionMore(x))

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by