How to debug the error *Not enough input arguments* in the following code ?

2 views (last 30 days)
% RUNME.m -- example using of the foregorund extractor. % % Nicholas R. Howe % March 10, 2005. % Please read copyright.txt
disp(' '); disp('This example shows the basic use of the foreground '); disp('extraction package. We''ll use a simple video of '); disp('someone walking.'); disp(' '); disp('>> avi = VideoReader(''SampleVideo.avi'');'); disp('>> frames = {avi.cdata};');
avi = VideoReader('SampleVideo.avi'); frames = {avi.cdata}; for i = 1:length(frames) imagesc(frames{i}); axis image off drawnow; end;
disp(' '); disp('First we''ll call extractForeground using the '); disp('default settings. (This may take a while.)'); disp(' '); disp('>> fg = extractForeground(frames);');
fg = extractForeground(frames); for i = 1:length(fg) imagesc(fg{i}); axis image off drawnow; end;
disp(' '); disp('This particular video gives better results with a '); disp('slightly lowered significanceThreshold.'); disp(' '); disp('>> fg2 = extractForeground(frames,[],[],[],[],4.5);'); disp(' ');
fg2 = extractForeground(frames,[],[],[],[],4.5); for i = 1:length(fg2) imagesc(fg2{i}); axis image off drawnow; end;

Answers (1)

Luuk van Oosten
Luuk van Oosten on 21 Nov 2014
For clarification, could you present your code as a code, and not plain text? this is unreadable.
Not enough input arguments means that your function, lets call it
>> function
requires -lets say- the input of 'a', 'x' and 'cookies'. so you would run:
function(a,x,cookies)
If the inputs is missing, you get the error
not enough input arguments
you probably ran the function like this:
>> function(a,cookies)
or
>> function
Which cannot run, because input argument(s) are missing.
Next time search the MATLAB answers section, a lot of questions have been solved before:

Community Treasure Hunt

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

Start Hunting!