Repmat
Computes triangular rvs from an set of input random numbers given min, max and mode values using the inversion method.This function can handle single value, vector and matrix input.Try the following examples to experiment with functionality.e.g. 1trimax = 700;trimin = 300;trimode = 500;rvs =...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (44): Triangular Distribution Tranformation - trirnd Download |
repToSize is an adaptation of repmat which requires only the final array size as the input. This removes the need to calculate the number of repetitions as well as handling for cases where a a fractional number of repetitions is required.If the final size is not a multiple of the original array's...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (42): repToSize Download |
Given an array, it is possible to imagine a virtual array formed by padding the original array out in all directions. Valid subscripts for this virtual array range through all the negative and positive integers, without regard to the size of the original. This function implements this idea.The...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (44): Extended array indexing Download |
Some curve fitting or smoothing tools can benefit from knowledge of the noise variance to expect on your data. Kalman filters use this information, also some spline fitting tools. So I wrote a function to extract the noise variance from a signal vector. It also works on any specified dimension of...
Platforms: Matlab
License: Freeware | Size: 10 KB | Download (47): Estimatenoise Download |
Learn how to use the Profiler tool, vectorized functions, and other tricks to writing efficient MATLAB code. This article includes how to convert any array into a column vector, bounding a value without if statements, and repeating/tiling a vector without repmat.Contents: * Introduction * The...
Platforms: Matlab
License: Freeware | Size: 327.68 KB | Download (48): Writing Fast MATLAB Code Download |
The function arg2vars serves for assigning of values from input argument(s) to variables declared in the output list in the place ofthe function calling. Not assigned output variables are empty, while superfluous arguments are cut to a number of output variables. Number of allocated items is a...
Platforms: Matlab
License: Freeware | Size: 10 KB | Download (43): Multiple assignment Download |
adjustpc(VALUEFORYEAR1,YEAR1,YEAR2) adjusts the number VALUEFORYEAR1 from what it was in YEAR1 to what it was in YEAR2. The adjustment is per capita, based on historical population data previously obtained from the U.S. Census Bureau.VALUEFORYEAR1 can be any number. YEAR1 and YEAR2 each can both...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (40): Adjust Per-capita Download |
This function does the decomposition of a separable nD kernel intoits 1D components, such that a convolution with each of thesecomponents yields the same result as a convolution with the full nDkernel, at a drastic reduction in computational cost.SYNTAX:======= [K1,KN,ERR] =...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (43): Kernel decomposition Download |
NDSPACE N-dimensionally spaced points NDSPACE(X1, X2) generates a column matrix of 10^n linearly equally spaced points in the hypercube defined by the two diametrically opposite cornerpoints X1 and X2 both n-by-1 vectors. If either is a scalar it will be expanded to repmat(X,n,1). NDSPACE(X1, X2,...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (46): N-dimensionally spaced points Download |
vec2orbElem(rs,vs,mus) converts positions (rs) and velocities (vs)of bodies with gravitational parameters (mus) to Keplerian orbital elements.INPUTS: rs: 3n x 1 stacked initial position vectors: [r1(1);r1(2);r1(3);r2(1);r2(2)r2(3);...;rn(1);rn(2);rn(3)] or 3 x n matrix of position vectors. vs: 3n...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (53): Orbital Elements from Position/Velocity Vectors Download |
Inverse every 2D matrix slice (the first two dimensions) for multi-dimensional array M: M(:,:,p,q,...) * X(:,:,p,q,...) = repmat(eye(m),[1,1,p,q,...]),where input M is a N-D array (m x m x [p x q x ...]), for all possible m=1,2,3,...and optional higher dimensions. Output X array has the same size...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (39): Inversion every 2D slice for arbitrary Multi-dimension array. Download |
The class ndSparse defined in this submission will give a lot of the functionality of N-dimensional sparse arrays for N possibly greater than 2. However, it should really be thought of as a way of starting with an ordinary MATLAB sparse matrix and reshaping it to have N dimensions. In other...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 20.48 KB | Download (44): N-dimensional sparse arrays Download |
% Sample valuesh = 10; % heightra = 1.5; % radius% Create constant vectorstht = linspace(0,2*pi,100); z = linspace(0,h,20);% Create cylinderxa = repmat(ra*cos(tht),20,1); ya = repmat(ra*sin(tht),20,1);za = repmat(z',1,100);% To close the endsX = [xa*0; flipud(xa); (xa(1,:))*0]; Y = [ya*0;...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (39): Plot cylinder Download |
Consider the following problems:- is HH or TH more likely to appear first in a series of coin flips?- how long does it take on average for a monkey to type out the phrase "to be or not to be"?WORDHIT solves the general problem for any list of reasonably-sized words. For example,wordhit('HH','TH')...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (48): wordhit Download |
x=[ NaN 0 1 NaN % NaN= not a number 0 0 1 1 0 0 1 1 NaN 0 1 NaN NaN 0 1 NaN NaN NaN NaN NaN ];y=[ NaN 0 0 NaN 0 0 0 0 1 1 1 1 NaN 1 1 NaN NaN 0 0 NaN NaN NaN NaN NaN ];z=[ NaN 0 0 NaN 0 1 1 0 0 1 1 0 NaN 0 0 NaN NaN 0 0 NaN NaN NaN NaN NaN ]; cc=zeros(8,3); % zeros crea un arreglo de 8(Colores)...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (46): RGB Cube Download |
ISVALIDSYMBOL - Check string to be a valid Matlab symbolThis function is equivalent to Matlab's ISVARNAME, but accepts cell strings as input also. While the speed is comparable for strings, it is *much* faster for cell strings (see screenshot).L = isValidSymbol(S)INPUT: S: String or cell...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (42): isValidSymbol Download |
Embiggen is a class that makes Matrix-vector operations easier by virtually matching the size of a vector b to the size of amatrix A. This allows for such code as: C = A + Embiggen(b) Here A is a matrix (for example of size 100x50)b is a vector (for example of size 100x1) And the equation is...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (39): Embiggen Download |
STOPLOOP - creates stop button to have a user interrupt a loop FS = STOPLOOP creates a message box window and returns a structure FS thatholds two functions, called FS.Stop and FS.Clear. The function FS.Stop()will return true, if the OK button has been clicked (or the message boxhas been...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (39): STOPLOOP (v1.0, jun 2008) Download |
ELLIPSESELECT An interactive ellipse selection tool HE = ELLIPSESELECT('init', A, B, X0, Y0, PHI, STYLE)Creates the ellipse and initialzes callbacks. Returns the handle of the ellipse HE. Ellipse parameters: A Length of the semi-major axis B Length of the semi-minor axis X0 Abscissa of the...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (44): Ellipseselect Download |
CMAPLINE finds all lines in an axis and specifies their colors according to a colormap. Also accepts custom colormaps in the form of a n x 3 matrix.EXAMPLE (generates screenshot)%generate some datax=(0:0.1:2*pi);m=50; exdata=bsxfun(@plus,repmat(25.*sin(x),...[m...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (47): CMAPLINE Download |