Map 410874 frames to time limits between 0 and 2062637 with a length of 10ms for each frame [closed]

StackOverflow https://stackoverflow.com/questions/21935249

Frage

I have 410874 frames each of which I want to map between a time limit between 0 and 2062637 with a length of 10ms interval. so that after the process each frame will be matched against a time as given below

1 0
2 10
3 20
4 50
5 60
6 70
. .
. .
. .
410874 2062637
War es hilfreich?

Lösung

look at linspace(a,b,n), this should be easy for you :)

you can simply make a vector of 410874 elements which span from 0 to 2062637 by using

t=linspace(0,2062637,410874);

although the points will only be ~5ms from eachother not 10ms as you stated because 2062637 / 410874 = 5.0201, so if you want 10ms you have to reduce the number of elements

t=t(1:2:end)

or

t=0:10:2062637;

the later will give you a 1x2062640 array, again cause those numbers dont fit your specifications.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top