How to produce all possible combination of matrices when deleting vector rows from original matrix?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Naveed Hossain
el 5 de Ag. de 2018
Respondida: Rik
el 5 de Ag. de 2018
I want to delete 5 vector rows from a 40 x 2 matrix, to give me 40C5 possible combinations ie 658 008 possible matrix combinations? Is this possible to do on MATLAB via iteration?
Any suggestions on which functions to use would be appreciated
0 comentarios
Respuesta aceptada
Rik
el 5 de Ag. de 2018
This should help you along. The construction with the for-loop makes use of the fact that Matlab loops through the second dimension, so numel(rows) is 5.
data=rand(40,2);
for rows=nchoosek(1:40,5)'
tempdata=data;tempdata(rows,:)=[];
%put actual calculation using tempdata here
end
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Elementary Math 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!