I have managed to find the answer on my own question.
% this line will create random configuration
robotConfig = robot.randomConfiguration; % how to set values i.e. define values
% this line returns actual values of the joints in rad
[a1, a2, a3, a4, a5, a6] = robotConfig.JointPosition;
A = num2cell([0.1, 0.2, 1.2, 1.1, 0.6, 0.8]);
[robotConfig.JointPosition] = A{:};
And it works as supposed to. But this requires that robotConfig is created first with random values and then use this struct to set new values. There must be a better way.
The documentation mention this:
"You can generate a configuration using homeConfiguration(robot), randomConfiguration(robot), or by specifying your own joint names and positions in a structure array." but there is no example how to specify my own position values.
If there are any other suggest, I'd greatly appreciate it.