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
-
351 Solvers
-
401 Solvers
-
626 Solvers
-
586 Solvers
-
870 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!