The equation of a straight line can be expressed in the slope-intercept form, which is given by:
\[ y = mx + b \]
where \( m \) represents the slope and \( b \) represents the y-intercept.
In your case, the slope \( m \) is 2 and the y-intercept \( b \) is 7. Therefore, we can substitute these values into the equation:
\[ y = 2x + 7 \]
So, the equation of the function is:
\[ y = 2x + 7 \]