Incorrect measurement would occur when vector magnetometer is slanting in ship’s magnetic measuring, thus a method is proposed to correct attitude of magnetometer. A standard magnetometer is placed closed with the declining magnetometer, and APO arithmetic is used to calculate matrix of attitude angle taking standard measured value as criterion, then accurate value of ship’s magnetic field can be got by revising measured value of slanting magnetometer based on the matrix. The method is verified by simulation and ship model’s experiment, and the result indicated that the measured precision is improved greatly. The method can be applied to engineering and supports a path for improving the precision of ship’s magnetic measurement.