Problem 61033. The MATLAB Treasure Hunt – Fix the Broken Compass by Normalizing Its Angle Readings

Your compass, recovered from the Hidden Cave, spins wildly! The ancient device shows angles that exceed 360° or drop below 0°. To follow the treasure trail, you must normalize each angle so it lies between 0° and 359°.
Given a vector a of compass readings (in degrees), return a vector b containing each reading normalized to this range. Use modulo arithmetic — your MATLAB compass is the key to the next map clue!

Solution Stats

76.47% Correct | 23.53% Incorrect
Last Solution submitted on Oct 25, 2025

Solution Comments

Show comments

Problem Recent Solvers13

Suggested Problems

More from this Author22

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!