version 1.0.0 (1.44 KB) by Hyeokjin Jho
nargout for methods, and inherited methods


Updated 25 Oct 2018

View License

nargout doesn't work for methods. Although some workaround was proposed(, it does not work for inherited methods. This function extends nargout function to methods and inherited methods.

function nargout_class(C,M)

% input
% C : name of the class (char) or Object

% M : name of the method (char) or method handle (function_handle)

% output
% n : number of output argument of method M (double)

Cite As

Hyeokjin Jho (2022). nargout_class (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018b
Compatible with R2008b and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!