Yosemite from Los Angeles? Amtrak gets you to Merced from L.A. Union Station (and other stops). The leg between Union Station and Bakersfield is by Amtrak Bus (as there are no tracks). From Bakersfield to Merced, it's by train, which is unusual because you see different countryside over the usual Highway 99 route. Keep in mind that Amtrak service is unreliable in that there are frequent delays. You can also take regular bus service to Merced.
From Merced, take the regional bus service to Yosemite Valley, YARTS. It stops at all the Valley hotels, including Curry Village.
http://www.yarts.org/The summer schedule (mid-May through Sept.) is more frequent than other times of year.