Replace "a22" in your expression for P with "A(2, 2)" [and similarly for a33] and add in some square brackets, maybe some semicolons and/or commas to make it explicit what matrix you're creating, and you should be all set.
For part 2, I'll just give you a hint: look at the diag function.