Varargin - mistake in my example
Mostrar comentarios más antiguos
Hi everyone, I wrote the following function:
function [x] = ingressi_arbitrari(varargin)
x=0;
for k=1:nargin
x=x+1;
end
end
Why if I run a=ingressi_arbitrari([2 3]) in the command window, the result is a=1 instead of a=2 (I choose two input arguments)?
Thank you very much.
Respuesta aceptada
Más respuestas (1)
Andrei Bobrov
el 13 de Mayo de 2017
use:
ingressi_arbitrari(2,3)
Categorías
Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!