VChooseKR
- Downloads:
- Views:
- Rating:

VChooseKR(V, K) creates a matrix, which rows are all combinations created by choosing K elements of the vector V without order and with repetitions.
INPUT:
V: Array of class DOUBLE, SINGLE, (U)INT8/16/32/64, LOGICAL, CHAR.
Prefer (U)INT8 or (U)INT16 for speed.
K: Number of elements to choose.
OUTPUT:
Y: Matrix of size [(N+K-1 over K), K] and same class as V.
EXAMPLES:
Choose 2 elements from [1,2,3,4]:
VChooseKR(1:4, 2)
==> [1,1; 1,2; 1,3; 1,4; 2,2; 2,3; 2,4; 3,3; 3,4; 4,4]
For speed cast the input to integer types if possible:
Y = VChooseKR(int8(1:64), 3)
is 6 times faster than with DOUBLEs!
To get the combinations of cell arrays, use the combinations of the index:
C = {'a', 'b', 'c', 'd'};
C2 = C(VChooseKR(1:4, 2))
==> C2 = {'a','a'; 'a','b'; 'a','c'; 'a','d'; 'b','b'; 'b','c'; ...
'b','d'; 'c','c'; 'c','d'; 'd','d'}
This MEX version is faster than COMBINATOR of Matt Fig: E.g. ~7 times for K=64, N=2, ~140 times for K=2, N=128. The older PICK of Stefan Stoll is slower than COMBINATOR. See screen shot.
Tested: Matlab 6.5, 7.7, 7.8, WinXP, Compilers: BCC5.5, LCC2.4/3.8, Open Watcom 1.8
Please run the unit-test TestVChooseKR after compiling or to compare the speed with other functions from the FEX, if they are found in the path.
See also: VChooseK (no repetitions, no order):
http://www.mathworks.com/matlabcentral/fileexchange/26190
VChooseKRO (repetitions, order):
http://www.mathworks.com/matlabcentral/fileexchange/26242
I'd appreciate suggestions for improvements and bug reports sent through email - thanks.
Free download from Shareware Connection - VChooseKR(V, K) creates a matrix, which rows are all combinations created by choosing K elements of the vector V without order and with repetitions
Version: 1.0 | Size: 10 KB | Platform: Matlab, Scripts
Released Date: 17-04-2013 | Rating: 0 | Title: VChooseKR
Author Url: http://www.mathworks.com
Program Info Url: http://www.mathworks.com
Download Url: http://www.mathworks.com/matlabcentral/fx_files/26277/1/VChooseKR.zip
ScaleTime - ScaleTime - fast linear matrix interpolation
DateStr2Num - DATESTR2NUM - Fast conversion of DATESTR to DATENUM
FilterM - FilterM, FiltFiltM: Fast digital filter
strncmpr - Compare last N chars of strings or cell strings
Patch FILTFILT - If applied to a matrix, the function FILTFILT (Signal Processing Toolbox) calls itself recursively for each column.
SimpleTest
WordPress Auto Poster Plugin
Professional Simulink Audio Equalizer
PHP Print / Echo
Ends Smart Form
Output buffering, and how it can change your life
ScriptCase - PHP Code Generator
Advanced Istaller for Java
Wind Turbine Model
FORMfields - The PHP Framework
C to C++ Converter
C++ Compiler
RTFGen - the PHP RTF generator
Cumulative Mann-Kendall trend test
Affiliate Programs
Animation
Auctions
Audio Systems
Banner Rotation
Blog
Bulletin Boards & Forums
Business & Enterprise
Buttons
Calendars & Events
Charts & Graphs
Chat
Classified Ad Managers
Communication
Screen Ocr Copy
Screen Cover
Screen Save Cow
Screen S Create
Screen Sav Cube
VChooseKRO - VChooseKRO(V, K) creates a matrix, which rows are all permutations created by choosing K elements of the vector V with order and with repetitions.
TN BRIDGE Host Integration Pack for .NET - TN BRIDGE Host Integration Pack for .NET is a set of components and productivity tools that extend and take advantage of already developed and tested screen-oriented host applications. ActiveX, Delphi 2010 and Delphi XE version available. Contact us.
TN BRIDGE Host Integration Pack for Delphi 2010 - TN BRIDGE Host Integration Pack 3.5 is a set of components and productivity tools that extend and take advantage of already developed and tested screen-oriented host applications. Delphi, ActiveX and .Net version available. Contact us.
Host Integration Pack for Delphi XE - TN BRIDGE Host Integration Pack 3.5 is a set of components and productivity tools that extend and take advantage of already developed and tested screen-oriented host applications. Delphi, ActiveX and .Net version available. Contact us.
TN BRIDGE Host Integration Pack for ActiveX - TN BRIDGE Host Integration Pack 3.5 is a set of components and productivity tools that extend and take advantage of already developed and tested screen-oriented host applications. Delphi, ActiveX and .Net version available. Contact us.
Shareware Connection periodically updates pricing and software information of 'VChooseKR' from company source 'Jan Simon' , so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using 'VChooseKR' crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of VChooseKR.
LogmeOnce Password Manager Ultimate - Irrespective of your computer and web usage needs it is quite imperative that you will deal with passwords, in fact plenty of them. Both home and corporate network users need to log in to several web services and sites and for each of them, user ...
Nuance 4 Dragon Dictate Mac - While Mac users resort to using third party apps for image editing or video editing needs, they are not bothered much about voice dictation software. This has also got to do with the fact that latest versions of OS X including Mountain Lion ...
IDrive Classic - For every type of computer user, backing up data has become near compulsory. Apart from data loss caused by hardware snags, you cannot rule out the risk of data loss caused by malware attacks. That explains why millions of PC users back up their ...
WinKleaner Classic - Whether you use a laptop or desktop, with time it is likely to show deficit in performance and speed. This is owing to the inherent limitations of Windows OS and things can vary based on your usage pattern. Traces of removed programs existing in ...
MAGIX Video easy - Editing videos was a complicated task even a few years back and it was restricted to studios and post production areas in general. However, advancements in computer technology and advent of numerous portable video capture devices have made things ...
PCMark 8 - Not every PC user would have penchant for running new benchmarks and benchmarking software in their computers. It is only hardcore gamers and seasoned users who like tinkering around with various settings in PC benchmarking tools. Such apps also ...
Dragon NaturallySpeaking Standard - No matter what type of computer you use, it becomes necessary to use keyboard for typing. This is the case with average home users as well as network administrators working in professional setups. Would not it be nice if you could give your hands ...
Protector Plus 2014 (32-bit) - Without using suitable security software in PC, you cannot have peace of mind nowadays. Increasing instances of malware attacks and attacking exploits have prompted average PC users to resort to using antivirus and security suites for both home ...
Screenpresso Pro - Capturing screenshots and webcam streams can become a necessity at times for PC users. There was a time most users resorted to Windows bundled print screen utility but now there are so many choices to pick from. If you want a feature rich and ...
Adobe Media Encoder - Almost every PC user faces a situation where he or she needs to convert an audio or video file fast into a format of choice. There are several free and commercial apps, but the abundance of options can actually make selection difficult. If you ...
