Borrar filtros
Borrar filtros

How random sample rows through many ranges of a matrix and delete from the original one and print in another one?

2 visualizaciones (últimos 30 días)
I generated a lot of outputs from a DFT rotine and put all of them in a single sheet and imported as a matrix to MATLAB, something like:
U n m erg
0 0,0833 0,0833 -2
0,050 0,08333 0,0833 -2
0,100 0,0833 0,0833 -2
0,150 0,0833 0,0833 -2
...
6 0,0833 0,0833 -2
...
20,00 0,0833 0,0833 -2
It goes from 0 to 20 for each test, so the whole matrix keeps repeating from 0 to 20 until I have almost 20k rows.
What I need is to random sample 40 rows from 0 to 6, then another 40 from 6 to 20, through the whole matrix. I want to able to sample and delete from the original one and print in another matrix.
Is it possible to automatize the whole process and/or is easier if I keep repeating the sampling manually?
Thank you.

Respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by