Functions

조회 수: 1 (최근 30일)
Mads Svendsen-Tune
Mads Svendsen-Tune 2011년 3월 27일
Hi all.
if a have a function:
x_out = f(x), where x is some vector.
How would i create a new function where a subset of the vector has been given as input:
x_out = f(x(3:4))
Thanks a lot
  댓글 수: 2
Paulo Silva
Paulo Silva 2011년 3월 27일
you already answered your own question!
Mads Svendsen-Tune
Mads Svendsen-Tune 2011년 3월 27일
How do you mean?

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

채택된 답변

Walter Roberson
Walter Roberson 2011년 3월 28일
f34 = @(x) f(x(3:4));
  댓글 수: 1
Mads Svendsen-Tune
Mads Svendsen-Tune 2011년 3월 28일
Thanks a lot!

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

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by