sampling from a matrix
Ältere Kommentare anzeigen
Hello I am going to sample some columns in a matrix and return the columns that are not selected during the sampling. could you please help me?
Akzeptierte Antwort
Weitere Antworten (1)
Sample how? If use randperm, say, as
icol=randperm(size(x,2),N);
to select N random columns from the array x to get the "nonsampled" columns you could instead simply use
inot=randperm(size(x,2),size(x,2)-N);
which is simply picking a random set of the obverse size to not sample--same thing in the end.
Or, if you are using the sampled column values first and then wanting the ones that weren't used both then first select as in the former and the other columns are simply
inot=setdiff([1:size(x,2)],icol);
1 Kommentar
Mohamad
am 21 Dez. 2013
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!