필터 지우기
필터 지우기

loop to create 3x3 matrix for each frame

조회 수: 1 (최근 30일)
Oliver Kumar
Oliver Kumar 2016년 3월 10일
댓글: Oliver Kumar 2016년 3월 10일
Hi
I want to build a 3x3 Matrix from 3 vectors.
R.fcsR = [Xn.fcsR; Yn.fcsR; Zn.fcsR];
I have captured a movement of a point over 247 frames. How can I make a for loop, so that for every frame a new 3x3 matrix is created. Thanks for your help.
Oli
  댓글 수: 1
Oliver Kumar
Oliver Kumar 2016년 3월 10일
편집: James Tursa 2016년 3월 10일
What I want to do is something like this. But I don't get it right...
for i = 1:247
R.fcsR(i,:) = [Xn.fcsR(i,:); Yn.fcsR(i,:); Zn.fcsR(i,:)];
end

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

채택된 답변

James Tursa
James Tursa 2016년 3월 10일
Does this do what you want:
R.fcsR = zeros(3,3,247);
for i = 1:247
R.fcsR(:,:,i) = [Xn.fcsR(i,:); Yn.fcsR(i,:); Zn.fcsR(i,:)];
end
  댓글 수: 1
Oliver Kumar
Oliver Kumar 2016년 3월 10일
Jup, that's exactly what I needed! Thanks!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by