screen – Android: how to rotate the output of the Galaxy S4 (using the MHL cable)?

I have a Samsung Galaxy S4 connected to a Dell monitor with an MHL cable. The default output for my application is the vertical mode on my landscape-oriented PC monitor:
enter the description of the image here

I would like to be able to rotate the monitor output 90 degrees counterclockwise. That way, when I rotate the monitor to the vertical orientation, the application is correctly displayed by occupying the full width of the monitor in vertical orientation and the total length of the monitor in vertical orientation (total length from top to bottom). Any ideas on how to rotate the output to the monitor and keep it as it is on the phone?