# How to create a vector for multiple frames of data in rows and columns?

5 visualizzazioni (ultimi 30 giorni)
Amanda il 27 Feb 2023
Commentato: Jan il 28 Feb 2023
I have data from a walking data collection. Each marker has two columns of data and 134 rows of data. I need to create a vector that corresponds to the time of each frame starting at 0. I am assuming this would need to be done with some of loop. If anyone could help that would be great.
##### 1 CommentoMostra NessunoNascondi Nessuno
Luca Ferro il 27 Feb 2023
could you share the data?

Accedi per commentare.

### Risposte (1)

Jan il 27 Feb 2023
The actual question is: "I need to create a vector that corresponds to the time of each frame starting at 0"
t = linspace(0, 133/120, 134) % Yes: 133/120, not 134/120
t = 1×134
0 0.0083 0.0167 0.0250 0.0333 0.0417 0.0500 0.0583 0.0667 0.0750 0.0833 0.0917 0.1000 0.1083 0.1167 0.1250 0.1333 0.1417 0.1500 0.1583 0.1667 0.1750 0.1833 0.1917 0.2000 0.2083 0.2167 0.2250 0.2333 0.2417
##### 2 CommentiMostra 1 commento meno recenteNascondi 1 commento meno recente
Jan il 28 Feb 2023
Expand:
thigh_vector = atand((RGRT(2)-RLCO(2))/(RGRT(1)-RLCO(1)));
to the complete columns:
thigh_vector = atand((RGRT(:, 2) - RLCO(:, 2)) ./ (RGRT(:, 1) - RLCO(:, 1)));
You need the elementwise division ./ instead of the array division / here.

Accedi per commentare.

### Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by