Problem 3004. Two functions (to be sure)
I want to compute the number of odd/even numbers in an array. But I want the results by two different functions.
Example:
x=1:10; assert(isequal(odd_fcn(x),5)) assert(isequal(even_fcn(x),5))
So you must solve this problem by writing 2 functions.
But you can only submit one function at the time.
Do you think it's possible?
HINT: I always test odd_fcn first. So odd_fcn must create the other function...
Solution Stats
Problem Comments
-
1 Comment
Jan Orwat
on 12 Feb 2015
Tons of possibilities here is the thing I like the most about this problem.
Solution Comments
Show commentsProblem Recent Solvers18
Suggested Problems
-
Project Euler: Problem 16, Sums of Digits of Powers of Two
178 Solvers
-
313 Solvers
-
Make a random, non-repeating vector.
11158 Solvers
-
Getting the row and column location from a matrix
297 Solvers
-
Test if two numbers have the same digits
262 Solvers
More from this Author43
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!