K-means Clusteringk-means clustering is a method of vector quantization, originally from signal processing, that is popular for cluster analysis in data mining. k-means clustering aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean, serving as a prototype of the cluster. This results in a partitioning of the data space into Voronoi cells. DownloadGithubUsageMATLAB - Unzip the file and use the test function as follows: `>>test_kmeans` Python / MATLABClone the repository: `>> git clone ` git@github.com:rezaahmadzadeh/K-means.gitPython `>>python k-means.py` Expectation-Maximization AlgorithmThe Expectation–Maximization (EM) algorithm is an iterative method to find maximum likelihood or maximum a posteriori (MAP) estimates of parameters in statistical models, where the model depends on unobserved latent variables. The EM iteration alternates between performing an expectation (E) step, which creates a function for the expectation of the log-likelihood evaluated using the current estimate for the parameters, and a maximization (M) step, which computes parameters maximizing the expected log-likelihood found on the E step. These parameter estimates are then used to determine the distribution of the latent variables in the next E step. DownloadUsageUnzip the file and use the test function as follows: `>>test_em` GithubUsageclone the repository: `>> git clone ` git@github.com:rezaahmadzadeh/Expectation-Maximization.gitRamer-Douglas-Peucker AlgorithmThe Ramer-Douglas-Peucker algorithm is a line-simplification algorithm. Given a curve specified with N points and an approximation tolerance, the algorithm selects a number of points M (M<=N) that approximate the original curve with the given tolerance. The Ramer–Douglas–Peucker algorithm (RDP) is an algorithm for reducing the number of points in a curve that is approximated by a series of points. This algorithm is also known under the names Douglas–Peucker algorithm, iterative end-point fit algorithm, and split-and-merge algorithm. DownloadUsageUnzip the file and use the function as follows: `>>testDouglasPeucker` Collatz ConjectureThe conjecture can be summarized as follows. Take any positive integer n. If n is even, divide it by 2 to get n / 2. If n is odd, multiply it by 3 and add 1 to obtain 3n + 1. Repeat the process (which has been called "Half Or Triple Plus One", or HOTPO) indefinitely. The conjecture is that no matter what number you start with, you will always eventually reach 1. Downloadcollatz.zipUsageUnzip the file and use the function as follows: `>>collatz(7)` `>>checkCollatz(2:1000)` When a function was released by MATLABThis is a handy function which MATLAB should have done it before. It returns the version of MATLAB that the input function was released with. DownloadUsageUnzip the file and use the function as follows: `>>when('rand')` `>> ##[rand] is a built-in Matlab function (Introduced before 2006a).` Boyer-Moore Majority Vote AlgorithmThe Boyer-Moore Vote Algorithm solves the majority vote problem in linear time O(n) and logarithmic space O(\log n). DownloadUsageUnzip the file and use the function for instance `>> MajorityVote('aaaccbbcccbcc') ` Visuospatial Skill Learning (VSL) (new)A demo of Visuospatial Skill Learning approach RepositoryUsageClone the repository on your machine `>> demonstration.m` `>> reproduction.m` Global Image ThresholdComputes the global threshold level using Otsu's method DownloadUsageUnzip the file and use the function for instance: `>> otsu(imhist(Igray),numel(Igray))` Sorting AlgorithmsSimple Sorting Algorithms including: 1- Bubble Sort 2- Cocktail Sort 3- Odd-Even Sort 4- Insertion Sort DownloadUnzip the file and use the algorithms for instance: `>> A = rand(1,100);` `>> SortedA = bubbleSort(A);` Toolbox Check in MATLABCheck to see if a specific toolbox is installed. DownloadUsageUnzip the file and run isToolboxAvailable.m in MATLAB, for instance `>> result = isToolboxAvailable('Image Processing Toolbox','warning')` `>> result =` `>> 1` Stabilized Gram-Schmidt Orthonormal MethodThis function receives a set of linearly independent vectors and converts them to a set of orthonormal vectors. DownloadUnzip the file and run GramSchmidt.m in MATLAB, for instance: `>> GramSchmidth([3 2;1 2])` `>>ans =` ` ` ```
0.9487 -0.3162
``` ` 0.3162 0.9487` Function Approximation using Radial Basis Networks
DownloadFunction approximation using radial basis networks [MATLAB] Usage
Particle Swarm Optimization (PSO) Algorithm (Vectorized)
DownloadUsage
Van Valedhuizen's Test Suite Problems for Multi-objective Optimization
Download Usage
Model-based Policy Iteration Algorithm
DownloadUsage
Q-learning (Model-free Value Iteration Algorithm) with ε-greedy Exploration
DownloadUsage
Model-based Value Iteration Algorithm (Stochastic)
DownloadUsage
Model-based Value Iteration Algorithm (Deterministic)
DownloadUsage
Homogeneous 3D Transformation
DownloadUsage
Trajectory Generation (3rd and 5th order)
DownloadUsage
Edit Distance Algorithm - A Standard Dynamic Programming
DownloadUsage
Random Search Algorithm (RSA)
DownloadUsage
Z-N PID Controller Tuning (Zigler-Nichols)
DownloadUsage
Note: All the source-codes are free to use. You may modify it as you want. The author does not have any responsibility for any consequence of using these codes. Contact the author if you encountered any problem. Please provide references to the authors' publications in works using part of these codes. |

Miscellaneous >