Azzera filtri
Azzera filtri

loop to create 3x3 matrix for each frame

1 visualizzazione (ultimi 30 giorni)
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 Commento
Oliver Kumar
Oliver Kumar il 10 Mar 2016
Modificato: James Tursa il 10 Mar 2016
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

Accedi per commentare.

Risposta accettata

James Tursa
James Tursa il 10 Mar 2016
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

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by