Error while using Nargin

조회 수: 9 (최근 30일)
Kishore adibhatla
Kishore adibhatla 2012년 5월 21일
While using function nargin for a user defined function...matlab posts the follwing error:
'Too many output arguments.' What is the cause for this problem and how to solve this?? Please help me...
  댓글 수: 1
Oleg Komarov
Oleg Komarov 2012년 5월 21일
Post (edit) the entire error message and the line of code that generated the error.

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

답변 (1개)

Sean de Wolski
Sean de Wolski 2012년 5월 21일
It means you are calling the function with more outputs than are defined in it.
If your function is:
function y = fun(x)
and you call
[z w] = fun(x)
It will throw this error.
  댓글 수: 1
Jan
Jan 2012년 5월 22일
Especially the function "nargin" is called with more than 1 output in the OPs case.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by