필터 지우기
필터 지우기

feval variable number of arguements

조회 수: 2 (최근 30일)
Bryan Van Dyke
Bryan Van Dyke 2011년 5월 24일
I use feval to evaluate user created functions. These user created functions have five arguements, so the call is [return args]=feval(function_name, arg1,arg2,arg3,arg4,arg5);
A new user created function now has a need for 8 input arguements. The question is:
Can MATLAB query the function_name to determine the number of arguements required before the feval call? Thanks, Bryan

답변 (1개)

Jan
Jan 2011년 5월 24일
Of course you can check the name of the function before calling using STRCMP.
In such cases it is often more preactical to define the input arguments as cell:
Inputs = {arg1,arg2,arg3,arg4,arg5};
feval(function_name, Inputs{:})
Or the equivalent method for 8 inputs.
Anyhow, I do not have the impression, that I got your problem completely.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by