How do i use output of one function as input to the other ?

1 回表示 (過去 30 日間)
shubham shubham
shubham shubham 2020 年 11 月 24 日
回答済み: James Tursa 2020 年 11 月 24 日
suppose i have
function p= pos(x,y)
x=x+y;
p=x;
end
and another function
funtion z=neg(p,q) ----> How do I do this where I am passing p which is output of pos as input argument for neg?
c=p-q;
end

回答 (1 件)

James Tursa
James Tursa 2020 年 11 月 24 日
You can do this at the point where you are calling the function neg. E.g.,
z = neg(pos(x,y),q);

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by