This solution is outdated. To rescore this solution,sign in.
-
2 Comments
Why is this wrong? I produced a 5x5 checkerboard matrix when n=5 and a 4x4 checkerboard matrix when n=4.
This is because you have semicolon beside if statement and also you are checking only the second element of each row.
Suggested Problems
Remove any row in which a NaN appears
7568 Solvers
Create a cell array out of a struct
962 Solvers
583 Solvers
603 Solvers
407 Solvers
More from this Author95
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!