Can you really learn from playing against computers just like when playing against humans? I am wondering whether or not playing against chess against a computer will help you get better as quickly as playing against humans. 

The motivation for this questions come from video gaming. I used to play a certain video game called Rome:Total War a lot, which is a game in which you control 100s of troops in a battle set in ancient times. It also is a tactical and strategical game like chess, but the 2 are not really very similar in any other respect. 

In that game, I avoided playing against AI at all costs. That is because they play in a totally different way from humans, and you didn't really learn to play against humans from playing against the AI.

I myself have noticed that if I use some chess programs, the same kind of things happen. If I put it at a very low level, the computer still makes some good moves, however, if you capture something with your Queen, while the captured piece is protected by a pawn; the pawn won't take it, because the computer is trying to play terribly. This is totally not how humans would play, quite the opposite actually. 

So, my final question is: If you play x matches against the computer set at a comparable Elo rating, would you learn as much as playing X matches against a human with the same Elo rating?
I read an article in chess life about a man who won an significant open tournament even though he was unrated when he entered. He had practiced only against the computer. 

I myself have learned a lot of what I know from computer programs. It is very difficult to find good players here and the computer is always available. From what I have read you learn most when you play against a player who is just a little better than you are. The computer allows you to control the level of play of your opponent. This is most effective when you opponent can tell you afterward what you did wrong and what you did right, so you will want to have the computer analyze the game afterward. 

I would recommend also using books of games (or a database of games) where you can go over the analyzed games from players about your own strength. I have one of my grandfathers books which is a collection of games by Capablanca called "The Immortal Games of Cabablanca" the games early in his life helped me a great deal. I couldn't understand his later games enough to get much out of them.

To conclude I you can learn from playing a computer. They will play at the set level of play and can analyze your games, however use other sources to help you advance as well.