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