How do i break down 6000 Datapoints into 128 Points

1 visualización (últimos 30 días)
Jelthe
Jelthe el 31 de Mzo. de 2016
Editada: Jan el 31 de Mzo. de 2016
Hello,
i am fairly new to Matlab. I have x=6000 data points on one hand and y=128 data points on the other. How can i plot these? I thought about calculating the average of every 46 data points of the 6000. But i dont know how to do this. Maybe smooth()? Then how do i tell Matlab to take every 46 so i get a total of x=128 points.
i hope my question is clear.
thanks JT

Respuestas (2)

KSSV
KSSV el 31 de Mzo. de 2016
You may take maximum of x and minimum of x. Using linspace create 128 data points. Then do interpolation of this 128 data points of x with 6000 data points and then plot.

Jan
Jan el 31 de Mzo. de 2016
Editada: Jan el 31 de Mzo. de 2016
data = rand(1, 6000);
m = BlockMean(data, 1, 46);
Note that these are 130 points. Perhaps you want to interpolate at first:
m = ceil(6000 / 128);
n = m * 128;
datai = interp1(linspace(1, n, 6000), data, 1:n);
mi = BlockMean(datai, 1, m);

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by