If it cranks normally, it won't be anything related to battery/alternator.
Does it crank normally or slowly?
Do you have a check engine lamp? Actually, even if you don't, it's
probably a good idea to scan for trouble codes.
What you describe is characteristic of a crank sensor, coolant temp
sensor, or MFI relay intermittent failure.
I've also heard of a couple cases where there's poor contact on the ECM.
While I haven't personally experienced this on Hyundai, I've worked on a
couple Kias where they were fixed just by unplugging and reconnecting the