How can I return multiple output arguments from the INLINE function?
조회 수: 6 (최근 30일)
이전 댓글 표시
I am using the INLINE function and I see that there is no way to get multiple outputs from the INLINE function. An example of this would be as follows:
[a, b] = meshgrid(1, 1)
returns
a =
1
b =
1
If I now inline this function as follows:
f = inline('meshgrid(x, y)')
I obtain
f =
Inline function:
f(x,y) = meshgrid(x, y)
Typing
[a, b] = f(1, 1)
results in the following error:
??? Error using ==> inline.subsref
Too many output arguments.
채택된 답변
MathWorks Support Team
2009년 6월 27일
The ability to obtain multiple output arguments with the INLINE function is not available in MATLAB.
To work around this issue, use function handles as follows:
f = @meshgrid;
[a, b] = f(1, 1);
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Function Creation에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!