i want to make random size of my datasample.output must give random size array. As i am very new in matlab. please help.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Tonmoy saha
el 2 de Mzo. de 2015
Comentada: Guillaume
el 2 de Mzo. de 2015
r=datasample('ATCG',20);
r =
TCACCAAAATCACAGGTATG
0 comentarios
Respuesta aceptada
Guillaume
el 2 de Mzo. de 2015
Editada: Guillaume
el 2 de Mzo. de 2015
More explanation in the question would be helpful. Possibly, this is what you want:
pickfrom = 'ATCG';
howmany = 20;
pickvalues = pickfrom(randi(numel(pickfrom), 1, howmany))
That is use randi to select a random set of indices that give you which value to pick from your data set.
6 comentarios
Guillaume
el 2 de Mzo. de 2015
You'll get a lot more help by just posting questions on this forum. There's a lot of people here who are willing to help.
Más respuestas (1)
Jos (10584)
el 2 de Mzo. de 2015
you want a random size sample? Like this, perhaps:
DATA = 'ATCG'
K = randi([10 20],1) % random number between 10 and 20
Y = datasample(DATA,K)
1 comentario
Ver también
Categorías
Más información sobre Deep Learning Toolbox 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!