Plug the phone into the computer, then pull down the notifications. You should see one that says "Connected as ..." If it's connected as an MTP device, you're okay. If it's connected as something else, tap that notification and you'll be given a screen with choices of which connection type to use - MTP, PTP and, possibly, charging only.
If you don't see that notification, something's wrong. Either the cable is bad (or you're using a charging cable - which doesn't have any data wires), the charging port in the phone is bad or the USB port in the computer is bad.