How to input vector into a function handle

조회 수: 3 (최근 30일)
Ruby Teja Kusuma
Ruby Teja Kusuma 2021년 8월 31일
댓글: Walter Roberson 2021년 8월 31일
i have a function handle fx1=@(x,y,z) x*2+3*y+2z;
and a vector a=[1 2 3].
is there any possible way so that i can input a into fx, without changing a into a cell arrays?
thanks in advance
  댓글 수: 5
Ruby Teja Kusuma
Ruby Teja Kusuma 2021년 8월 31일
yeah this is excatly what im looking for, heavy thanks mate
Walter Roberson
Walter Roberson 2021년 8월 31일
If you just happen to be generating the function handle using matlabFunction() in the Symbolic Math Toolbox, then see the 'vars' option: it is possible to arrange that the generated function takes its input from a vector instead of from from individual arguments.

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

답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by