This solution is outdated. To rescore this solution, sign in.
-
2 Comments
Bryce
on 2 Feb 2012
Seems to me that the "best" answer would be tf = logical(mod(n,2)). But I guess the description does not explicitly require logicals, so maybe I am reading too much into the problem. Using logical makes the solution 17 compared to 13 without.
Adrian Dronca
on 7 Mar 2013
by calling logical function you add extra code.
Suggested Problems
-
9000 Solvers
-
3910 Solvers
-
1895 Solvers
-
Back to basics 11 - Max Integer
793 Solvers
-
931 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!