The equation of a function in slope-intercept form is given by the formula \( y = mx + b \), where \( m \) represents the slope and \( b \) represents the y-intercept.
Given that the slope (\( m \)) is 2 and the y-intercept (\( b \)) is 7, we can substitute these values into the formula:
\[ y = 2x + 7 \]
Thus, the equation of the function is \( y = 2x + 7 \).