필터 지우기
필터 지우기

How to copy only the output of a function and paste the output in another function?

조회 수: 2 (최근 30일)
Suppose the output of your first function is y1=x^2, and the input of your second function is y2=y1+10. How can I copy only the charechters "x^2" and paste that in y2?

답변 (1개)

Kevin Phung
Kevin Phung 2019년 2월 8일
function y1 = func1(x)
y1 = x^2
end
function y2 = func2(x)
y2 = x+10
end
y2 = func2(func1(2)) % if x=2
  댓글 수: 4
Zana Taher
Zana Taher 2019년 2월 8일
The reason I am interested in this approach is that this approach reduces the computational time by a great factor!
Zana Taher
Zana Taher 2019년 2월 8일
Not really the syms. I am actually using syms in the first function. I am also using subs() but is also somputationally expensive.
I just need that copy paste feature!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Function Creation에 대해 자세히 알아보기

태그

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by