Cody

Problem 44345. MATLAB Counter

Write a function f = counter(x0,b) to construct a counter handle f that counts with an initial value x0 and a step size b.

E.g.,

>> f = counter(0,1)  % Initialize a counter f() with initial_count = 0 and step_size = 1
>> f()
ans =
     0
>> f()
ans =
     1
>> f()
ans =
     2

Solution Stats

19.18% Correct | 80.82% Incorrect
Last Solution submitted on Nov 09, 2019

Problem Comments

Solution Comments

Problem Recent Solvers188

Suggested Problems

More from this Author43

Problem Tags