Borrar filtros
Borrar filtros

How to insert two matrices into a matrix?

4 visualizaciones (últimos 30 días)
Nora Hora
Nora Hora el 22 de Nov. de 2016
Comentada: Guillaume el 22 de Nov. de 2016
I would like to insert my matrices: R, R' and t,t' into an identity 4x4 matrix.
Then I would like to multiple them and as a result store from the final 4x4 matrix just the R^(3x3) and t^(3x1) matrices.
Thank you in advance for your help!

Respuesta aceptada

KSSV
KSSV el 22 de Nov. de 2016
Editada: KSSV el 22 de Nov. de 2016
I = eye(4) ;
R = rand(3) ;
t = rand(3,1) ;
I(1:3,1:3) = R ;
I(1:3,4) = t ;
or
I = eye(4) ;
R = rand(3) ;
t = rand(3,1) ;
I(1:3,1:4) = [R t]

Más respuestas (1)

Guillaume
Guillaume el 22 de Nov. de 2016
The first concatenation is simply:
[Rprime, tprime; 0 0 0 1]
The second:
[R, t; 0 0 0 1]
and so on.
  2 comentarios
Nora Hora
Nora Hora el 22 de Nov. de 2016
Thank you! And how would you save out the vector and the matrix from the result?
Guillaume
Guillaume el 22 de Nov. de 2016
You're talking about Rhat and that, then:
p = [Rprime, tprime; 0 0 0 1] * [R, t; 0 0 0 1];
Rhat = p(1:3, 1:3);
that = p(1:3, 4);

Iniciar sesión para comentar.

Categorías

Más información sobre Polynomials en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by