Error while using Nargin

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 Comment

Post (edit) the entire error message and the line of code that generated the error.

Sign in to comment.

Answers (1)

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 Comment

Jan
Jan on 22 May 2012
Especially the function "nargin" is called with more than 1 output in the OPs case.

Sign in to comment.

Categories

Find more on Function Creation in Help Center and File Exchange

Tags

Asked:

on 21 May 2012

Community Treasure Hunt

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

Start Hunting!