Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How do u pass the data calculated from the previous function to another function

조회 수: 1 (최근 30일)
komal Bhandari
komal Bhandari 2011년 11월 11일
마감: MATLAB Answer Bot 2021년 8월 20일
How do u pass the data calculated from the previous function to another function

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2011년 11월 11일
abs() is a function, so is sin().
a=-3;
b=abs(a);
c=sin(b);
or
sin(abs(-3))
Does this answer your question?
  댓글 수: 5
Fangjun Jiang
Fangjun Jiang 2011년 11월 11일
Maybe you should note that you need to make your function have an output argument.
function out=plus_one(in)
out=in+1;
function out=time_two(in)
out=2*in;
time_two(plus_one(1)) would yield 4.
Jan
Jan 2011년 11월 11일
@komal: You can read the code of e.g. MEAN: "edit mean.m". This is a function of a Matlab toolbox, but it is exactly the same mechanism as for user-defined functions. There are a lot of further good examples in the documentation and in the toolboxes.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by