How to use the rotation matrix calculated by Matlab in Blender? Good morning,
For a project, I created in MATLAB a scene composed of an object and twelve cameras looking at it. With the tool box of MATALB, I got the rotation matrix and the translation vector for each camera.
Now I would like to use these information (rotation matrix and translation vector) to create the same scene in Blender.
So I want to use the translation vector to position correctly my cameras in the space, so I will modify the location parameters in Blender with it.
I want to use the rotation matrix to get the correct rotation of my cameras in the space. So I will modify the rotation parameters with it.
The panel I am using  is this one:

For the rotation, I know in Blender, I can use the quaternion, the euler rotation angles (XYZ, YXZ, ZYX) or the axis vector. I calculated all of them with MATLAB but unfortunately they don't give the correct result. The cameras don't look in the correct direction as shown on the following pictures:

Camera's view:

What I would like is the camera looking at the object like on the following picture but with the parameters calculated by MATLAB. In this example, I use the object constraint properties:

So, in the view of the camera, we can see the object:

The rotation matrix of the first camera is:

Its translation is:

The XYZ angle calculated with this matrix by MATLAB is:

I read that MATLAB and Blender don't have the same coordinate system.
How can I do that?
Thanks for your help.
Some rattling on.
Not sure one arbitrary rotation matrix and one location vector with very little more info is enough. Instead of a very long commment, here is some ways to try and work this out.
The matrices given.
&gt;&gt;&gt; print(R)
&lt;Matrix 3x3 (-0.4877,  0.8728,  0.0190)
            ( 0.4404,  0.2648, -0.8578)
            (-0.7537, -0.4100, -0.5136)&gt;


 T = Matrix.Translation((1.5581, 1.2190, 1.4871))

In blender (row order matrix) the columns of a 3x3 rotation matrix are the vectors of local axes.  If the camera was placed such that it focused directly on (0, 0, 0) (In blender a camera looks down its $-Z$ axis)
For example in default blend, with a track to constraint on camera to look at cube at (0, 0, 0)
&gt;&gt;&gt; C.object
bpy.data.objects['Camera']

&gt;&gt;&gt; print(C.object.matrix_world.to_3x3())
&lt;Matrix 3x3 (0.6563, -0.3579,  0.6642)
            (0.7545,  0.3114, -0.5778)
            (0.0000,  0.8803,  0.4744)&gt;

&gt;&gt;&gt; print(C.object.matrix_world.translation.normalized())
&lt;Vector (0.6642, -0.5778, 0.4744)&gt;

ie its local  $Z$ axis matches its normalized location
if it was same for given data would expect
&gt;&gt;&gt; T.translation.normalized()[:]
(0.6295621991157532, 0.4925462305545807, 0.6008740663528442)

to match a column (or row, not sure of order) of rotation matrix, unfortunately it does not,.
Using angles given to  get this matrix by setting order to ZYX and transposing
&gt;&gt;&gt; print(Euler((map(radians, (141.4, -48.9, -137.9))), 'ZYX').to_matrix().transposed())
&lt;Matrix 3x3 (-0.4878,  0.8728,  0.0187)
            ( 0.4407,  0.2647, -0.8577)
            (-0.7536, -0.4101, -0.5138)&gt;

Reversed order suggests pitch, roll, yaw type rotation.
Transposing suggests either column order of matrices, it is also a cheap way of inverting a rotation matrix.
&gt;&gt;&gt; print(Euler((map(radians, (141.4, -48.9, -137.9))), 'ZYX').to_matrix().inverted())
&lt;Matrix 3x3 (-0.4878,  0.8728,  0.0187)
            ( 0.4407,  0.2647, -0.8577)
            (-0.7536, -0.4101, -0.5138)&gt;

Which also suggests there could be a difference in +/- for CW / CCW rotation.
&gt;&gt;&gt; print(Euler((map(radians, (-141.4, 48.9, 137.9))), 'XYZ').to_matrix())
&lt;Matrix 3x3 (-0.4878,  0.8728,  0.0187)
            ( 0.4407,  0.2647, -0.8577)
            (-0.7536, -0.4101, -0.5138)&gt;

Seeing what happens, set the matrix world to
C.object.matrix_world = T @ R.to_4x4()

for the hell of it in this one have used
C.object.matrix_world = T @ R.transposed().to_4x4()


since it is easy to see in image that (if the object of interest to focus is around (0, 0, 0)  it's looking the wrong way and is upside down.
Can make a conversion matrix via
&gt;&gt;&gt; bpy_extras.io_utils.axis_conversion(
...         from_forward='Z',
...         from_up='-Y',
...         to_forward='-Z',
...         to_up='Y')

Matrix(((1.0, 0.0, 0.0),
        (0.0, -1.0, 0.0),
        (0.0, 0.0, -1.0)))

Or can see that flipping 180 degrees around $X$ axis would give same result.
&gt;&gt;&gt; Matrix.Rotation(pi, 3, 'X')
Matrix(((1.0, 0.0, 0.0),
        (0.0, -1.0, -8.742277657347586e-08),
        (0.0, 8.742277657347586e-08, -1.0)))

So with one of the conversion matrices above as S
&gt;&gt;&gt; S = Matrix.Rotation(pi, 4, 'X')
&gt;&gt;&gt; C.object.matrix_world @= S


In as much as it doesn't exactly answer your question, I hope it gives enough info that if you have two locations and a rotation from each that points directly at a known point (eg the origin) then it would be a relatively easy task to work out the space.