Display a degree heading as a compass heading rather than a absolute heading from the origin.
Show older comments
title(sprintf('HMNZS AOTEAROA Ship motion in Sea state 6,\n Heading: %3.2f%c Runtime:%4.2f sec'...
, d , char(176), t), "Color", [1 1 1]); % Display Graph title with changeing data
I am wanting to display the heading of the vessel in a compass format. Currently, as it goes around in a circle the heading goes up to 758 degrees I believe there is a way to make it only display a heading from 0 to 359 deg.
I think it goes like this
C = Heading / 360
H = ??? % truncate CH to only leave digits after the decimal point
CH = H*360
Not sure how to truncate the whole numbers.
Thanks in advance
Accepted Answer
More Answers (0)
Categories
Find more on Lengths and Angles in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!