Hey grooverandshaker.

If you have the eigen-vectors then P is just made up by using the eigenvectors corresponding to a particular eigen-value while D has the eigenvalues in the diagonal (with zeroes everywhere else).

Try putting the eigenvectors on the appropriate rows of P, calculate P inverse and then do the multiplication and see if you get B back.

If you ever want to double check your work use something like Octave which does a lot of MATLAB does only its free and open source. (GUIOctave is the GUI front end for it and is a separate download).