I would like to know if there is any way to get all the possible solutions of inverse kinematics of a 6 DOF robotic arm? I have found some good Matlab codes but gives only one solution like in Peter corke's book . Thank you in advance.
I suggest you look at Craig's book Introduction to Robotics Mechanics and Control. In the inverse kinematics chapter he addresses the multiple closed-form solutions obtained analytically. Many other texts address this issue also.
In general, if the wrist is spherical (i.e., all three axes intersect), you can enumerate all of the various closed-form solutions through a method known as wrist partitioning. This method uses the three arm joints to solve for the position of the wrist center. It then uses the wrist joints to determine the joint angles which orient the end effector properly. Multiple solutions are possible from "wrist up" and "wrist down" options, "elbow up" and "elbow down" options (for an articulated arm), and "over the shoulder" options also. For other robot geometries the options would differ.
If the wrist is not spherical, it becomes quite challenging to find a closed-form inverse solution. But you still have the various geometric options for inverse kinematics solutions.
One way to make sure you are identifying all of the solutions is to recall the fundamentals of trigonometry. Recall that $\sin(\theta) = -\sin( - \theta)$ and $\cos(\theta) = \cos( - \theta)$. So when you are solving for $\theta$ you have to consider the other angles which produce the same result using these and other trigonometric identities.
There's a good overview of inverse kinematics methods in Springer Handbook of Robotics by Siciliano and Khatib. The authors explain which of these methods can be used to find all solutions for a 6-DOF arm. They cover both algebraic and a lot of numerical methods.
Also have a look at ikfast in openrave. It's a search-based method that finds a closed-form solution for the inverse kinematics given the robot's structure. The source code of ikfast contains a number of numerical inverse kinematics methods.
The Robotics Toolbox for MATLAB has an analytic solution,
ikine6s, that works for most 6DOF arms with a spherical wrist. It takes a configuration string. If you call it with all 8 possible combinations then you will get all possible solutions, eg.