MATLAB Answers

I am getting an error named Not enough input arguments for the function HelperPoolWaitbar below while running a code can anyone explain me how to solve it.

12 views (last 30 days)
POTNURU SAI VAMSI
POTNURU SAI VAMSI on 25 Sep 2021 at 6:09
Answered: Image Analyst on 25 Sep 2021 at 12:46
function obj = HelperPoolWaitbar(N,message)
if nargin < 2
message = 'PoolWaitbar';
end
obj.N = N;
obj.ClientHandle = waitbar(0, message);
obj.Queue = parallel.pool.DataQueue;
obj.Listener = afterEach(obj.Queue, @(~) localIncrement(obj));
end
  1 Comment
Walter Roberson
Walter Roberson on 25 Sep 2021 at 6:41
How are you invoking the function? Are you pressing the green Run button? Are you calling it with a line of code?

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 25 Sep 2021 at 12:46
Like it says, you're not passing in the required inputs. How did you call it in your script or command window. If you did something like
N = 4;
message = 'Hello POTNURU!';
obj = HelperPoolWaitbar(N,message)
then you should not get that particular error. So, what are your N and message? If they're undefined (like you clicked the green run triangle before you assigned anything to N and message) then of course it won't know what to do and throw an error.

Community Treasure Hunt

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

Start Hunting!

Translated by