I'm not saying that cooking everything somehow magically makes things affordable (as a matter of fact, now that I like cooking I spend more on food than I used to). But cooking the same meal as you'd buy somewhere is definitely more affordable. And it's a LOT easier to eat well when you're cooking your own food instead of eating frozen meals or going out.
If you're trying to keep it to $2 a meal, then it's not that hard to eat well either. When I was a poor college student my routine was something like:
Breakfast: eggs and bacon
Lunch: Sandwich and some veggies (I like broccoli or carrots)
Dinner: Whole chicken and potatoes
Overall it costs more than $2 to get the ingredients for each of those meals, but once you average it across the number of servings you're well under $2.