From A Distance
This script yields each subset of size k from a super set of size n. There are two methods. The first operates on sets of integers of the form range(n). The seconds operates on arbitrary sets or lists.
Platforms: Windows, Mac, *nix, Python, BSD Solaris
License: Freeware | Download (55): All k-subsets from an n-set Download |
This script finds the complement of a set of indices from a specific arange(n) array. Suppose, for example, you are given a linear array with 10 elements and you want to extract the elements from this array that have indices other than [1, 3, 5].You can then use this recipe to first find the...
Platforms: Windows, Mac, *nix, Python, BSD Solaris
License: Freeware | Download (57): A numarray set complement Download |
This basic model shows you how to acquire live data from a Tektronix oscilloscope into Simulink. This model was developed for the Tektronix TDS 2012 oscilloscope but may work with other Tektronix scopes with little or no modifications.To view the results, double click on each "scope" block in the...
Platforms: Matlab
License: Freeware | Size: 10 KB | Download (52): Data acquisition into Simulink using a Tektronix oscilloscope Download |
This function can 1. Find the shortest path and distance from a starting node to an ending node on a map** 2. Find the shortest paths and distances from a starting node to ALL other nodes on a map****The map should consist of nodes and segments, such that: 1. nodes have the format [ID X Y] or [ID...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (40): Dijkstra's Shortest Path Algorithm Download |
This script will step through the process of readingdata from a NetCDF file.Missing Data, as flagged in the NetCDF file, will bereplaced with a NaN value (Not a Number).Data is read from the file, and saved to the caller'sworkspace. If the NetCDF provides data attributes"scale_factor" and...
Platforms: Matlab
License: Freeware | Size: 10 KB | Download (49): Reading and Animating a NetCDF file of Sea Surface Temperature Download |
All the information required to compute the random sequence are extracted from the pp-form structure, in particular the lowest and the highest generated numbers corresponds to the first and last break of the pp form respectively.RANDPDFS uses FNINT to compute the cumulative distribution function,...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (44): Random numbers from a user defined piecewise polynomial distribution Download |
real time data plot from a serial portThis matlab script is for plotting a graph by accessing serial port data in real time. Change the com values and all variable values accroding to your requirements. Do not forget to add terminator in to your serial device program.
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (42): Real time Data plot from serial port Download |
This is useful function in case you want to enlist all files from a folder and it's sub-folder with given file extension list.Input argument is the folder name with complete path as a string(e.g. '/media/Nitin/SSA/FolderName').Output is a variable containing list of all files along with complete...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (45): Enlist all file names in a folder and it's subfolders Download |
ASHAPE is a simple wrapper for ASLIB, which implements several (optimized) subroutines to extract and display 2d alpha shapes and alpha patches from a set of x/y data pointsASLIB returns a structure, which contains all relevant parameters, data and results including graphics handles to plotted...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 92.16 KB | Download (44): ashape: a pedestrian alpha shape extractor Download |
computes the distance from a given line segment (in 2d) or draws an anti aliased linesee http://mathworld.wolfram.com/Point-LineDistance2-Dimensional.html for computation of the orthogonal distance to the line.Where appropriate, gets the orthogonal distance to the line, or one of the two end...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (44): Draw Line Segments (anti aliased) Download |
In this example you will learn the "function handler" from a "functor set" points-of-view. The functor set can store more than one functionhandlers, so one can choose a function handler from a functor set and pass it to another function as an input argument.
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (46): a functor set example Download |
This function extracts a scalar/vector/matrix of random numbers with discrete Probability Distribution Function.The PDF is specified by the user as a input vector.This function is designed to be fast, and it is implemented within a .mex fileFollowing Olivier B. comments (that I acknowledge for...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 71.68 KB | Download (47): Performing random numbers generator from a generic discrete distribution Download |
This test is based on the Wilks'method (1963) designed for detection of a single outlier from a normal multivariate sample and approaching the maximun squared Mahalanobis distance to a F distribution function by the Yang and Lee (1987) formulation. A significative squared Mahalanobis distance...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (44): moutlier1 Download |
This code solves biot savarts law to evaluate magnetic field from a circular coil at all points in the plane which is perpendicular to the plane of the coil.coil is situated in the X-Y plane centered at origin having radius =6 and we want to evaluate magnetic field at all points in the Y-Z plane....
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (46): Magnetic Field of a Current Loop using Biot Savarts Law Download |
I have found the functionality of being able to read data from a .txt file and storing them in a MATLAB matrix as quite useful and needed.Example application: imagine you having some data stored in a .txt file (from some measurements) and you want additionally to process them, visualize or just...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (51): Loader of a .txt file to a MATLAB matrix Download |
Sometime you need a specific field from a (large) number of mat files. With loadFields, the user can select all the mat files at once, and choose the required field using a pulldown menu. The values are returned as a single array if the field has always the same size, otherwise it returns a...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (43): loadFields from mat files Download |
This function enables you to directly write data from a cell array into a text file, which functions like FWRITE and FPRINTF do not.Usage:fwritecell(filename, format, data) writes cell array "data" to the file with name "filename" using the C language conversion specifications in argument...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (49): Write a cell array to a text file Download |
BWREMOVE Removes objects in binary image.BW3 = BWREMOVE(BW1,BW2) returns a binary image BW3 where the objects from the mask image that overlap the seed image are removed. Both the seed BW1 and the mask BW2 images can have multiple blobs.[BW3, BW4] = BWREMOVE(BW1,BW2) returns the binary image BW4...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (43): Removing blob(s) from a binary image Download |
The function BINOMIND does not use loops (apart from a redundant check) or division nor indeed factorials to generate the Binomial Coefficients (BCs). It simply constructs the lower-triangular Pascal matrix and does a simply lookup to get the desired BC.BINOMIND is much faster than NCHOOSEK at...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (46): Find and return Binomial Coefficients (BCs) in a matrix up to N Download |
This function finds duplicate values along the first column of a matrix, averages the remaining rows, and removes the duplicate rows.
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (46): Average and remove duplicates from a matrix Download |