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

조회 수: 2 (최근 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 CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by