Master Thesis Code
by Simon Moser
Loading...
Searching...
No Matches
num2axis.m
Go to the documentation of this file.
1% =========================================================================== %
2%> @brief convert a number to an axis
3%>
4%> @param num number to convert (1, 2, 3)
5%>
6%> @retval axis axis (x, y, z)
7%>
8%> @copyright see the file @ref LICENSE in the root directory of the repository
9% =========================================================================== %
10function axis = num2axis(num)
11
12arguments
13 num (1,1) double
14end
15
16num = round(num);
17
18switch num
19 case 1
20 axis = "x";
21 case 2
22 axis = "y";
23 case 3
24 axis = "z";
25 otherwise
26 error("The number %d does not correspond to an axis", num)
27end
28
29end
function num2axis(in num)
convert a number to an axis