Borrar filtros
Borrar filtros

Selecting random points from data file

4 visualizaciones (últimos 30 días)
amberly hadden
amberly hadden el 12 de Dic. de 2014
Comentada: amberly hadden el 12 de Dic. de 2014
Hi, is there any algorethim to select random points from a large data file. Lets say I want to select data after every 20 values. x = [1:0.1:1000]
If I want y = select every 10th 20th or 50th point of x
Thanks Amb
  4 comentarios
amberly hadden
amberly hadden el 12 de Dic. de 2014
Sorry if its not clear I mean to write pick every 10th or 20th point of x.
Amb
amberly hadden
amberly hadden el 12 de Dic. de 2014
sorry random means scanig rando area up down lesft right

Iniciar sesión para comentar.

Respuesta aceptada

Mohammad Abouali
Mohammad Abouali el 12 de Dic. de 2014
x = [1:0.1:1000];
x_every10th=x(10:10:numel(x));
x_every20th=x(20:20:numel(x));
x_every50th=x(50:50:numel(x));
You get the idea.
  4 comentarios
amberly hadden
amberly hadden el 12 de Dic. de 2014
yeah I have a 307000*3 matrix
want to select every 10th row. Is there any wany to data from random rows lets say for region I'm more interested I can select every 20th point for region Im not much interested slect every 50th and close to my sourse select every 10th point.
Thanks much apriciated
amberly hadden
amberly hadden el 12 de Dic. de 2014
another thing I want out put in 3 columns its just producing one column.

Iniciar sesión para comentar.

Más respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 12 de Dic. de 2014
x = [1:0.1:1000];
n=randi(5)*10
out=x(n:n:end)
  1 comentario
amberly hadden
amberly hadden el 12 de Dic. de 2014
randi is good option but how would I aviod repeation
Thanks

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by