필터 지우기
필터 지우기

How to insert two matrices into a matrix?

조회 수: 4 (최근 30일)
Nora Hora
Nora Hora 2016년 11월 22일
댓글: Guillaume 2016년 11월 22일
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!

채택된 답변

KSSV
KSSV 2016년 11월 22일
편집: KSSV 2016년 11월 22일
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]

추가 답변 (1개)

Guillaume
Guillaume 2016년 11월 22일
The first concatenation is simply:
[Rprime, tprime; 0 0 0 1]
The second:
[R, t; 0 0 0 1]
and so on.
  댓글 수: 2
Nora Hora
Nora Hora 2016년 11월 22일
Thank you! And how would you save out the vector and the matrix from the result?
Guillaume
Guillaume 2016년 11월 22일
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);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Polynomials에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by