Software Listing of Author : "Bruce"
- BINOMIALPDF : Binomial Probability Density function
- License: Shareware
- Price:


Very easy function to use that helps statisticians solve all kinds of problems. The function does not need the Statistics Toolbox. I have included the BINOMIND function which this one calls but you can download it separately if you like. I uploaded it to MATLAB Central as well. EX1: binomialpdf(40,6,0.1,'exact') % = bpdf(X=6) where 0.1 = 10% % ans = 0.106756244747289 % EX2: binomialpdf(11,2,0.1,'atmost') % = bpdf(X=0)+bpdf(X=1)+bpdf(X=2) % ans = 0.910438149150000 % EX3: binomialpdf(10,2,0.1,'atleast')% = bpdf(X=2)+...+bpdf(X=10) % ans = 0.263901070900000
- Platform: Matlab, Scripts
- Combinations, n choose k
- License: Shareware
- Price:


The combination function seems to be missing from MATLAB so this rendition fills the gap. MYCOMBNK returns combinatorial of n choose k i.e all unique combinations of n elements taken k at a time. EX: >> mycombnk(6,2) ans = 15
- Platform: Matlab, Scripts
- Compute the total resistance of n resistors in parallel
- License: Shareware
- Price:


This m-file function can be used in any area where the total electrical resistance of parallel resistors is required. Example usage: >> z = Rparallel3(1,1,1) z = 0.3333 >> By using 'varargin' Rparallel3 can take a variable number of input arguments (scalars only) allowed. I got the idea for this function from an Instructor for an Introduction course on MATLAB that I attended 3 years ago as a helper/attendee. The code has evolved a bit since my first foray into MATLAB but the function essentially performs the same as the first version I wrote as a learner 3 years ago.
- Platform: Matlab, Scripts
- Compute the total resistance of n resistors in parallel - new minor version
- License: Shareware
- Price:


This m-file function can be used in any area where the total electrical resistance of parallel resistors is required. The only real difference between this version and the old one is that the function now allows a single vector input parameter (row/column) as well as the usual multiple scalar arguments in the old version. Also the code is more compact than before, demonstrates the use of nargin and isvector and has been tested with MATLAB R2011a. Example usage: >> z = Rparallel31(1,1,1) z = 0.3333 >> z = Rparallel31([1;1;1]) z = 0.3333
- Platform: Matlab, Scripts
- Convolve/ Deconvolve Gaussian impulse response and unit impulse vectors
- License: Shareware
- Price:


This function plots a Gaussian impulse response, unit impulse and the % convolution/deconvolution of both using MATLAB's 'filter'. Specifically % it uses 'filter' rather than 'deconv' to do the deconvolution and thereby % returns the original Gaussian vector as well as the unit response vector. % Vector length is maintained at 16 in all cases, the length of the input % data vectors. % % By specifying a string for a filename you can save your % plot to a jpeg file. You can either edit the variables 'g','h' and 't' % to provide your data in row vector format or edit the given % 'inputData.mat' file to suit your needs. % % EX: % >> [a b c] = plotImpulses('afigure')
- Platform: Matlab, Scripts
- Custom solution for 3 non-linear simultaneous equations
- License: Shareware
- Price:


This customised function solves one type of non-linear system of 3 simultaneous equations in 3 unknowns: k, L and r0 in 3 equations with 4 knowns: zeta, eeta, d and angle. function matrixresults = symsolvenonlineq(n,degrees,dinput) % EXAMPLE USAGE: m=symsolvenonlineq(3,45,20) % nb: takes around 738s to process two 1 x 1000 matrices INPUT Parameters: % n determines size of a random matrix for zeta and eeta, % degrees is the angle and sets constant 'angle' (in radians), % dinput sets constant 'd'. % %OUTPUT: %returns a 2D matrix of results for k,L and r0. % %5 things to note: %1/ you need to do a 'clear all' prior to running the function %otherwise it may crash on big input matrices; %2/ could not use 'zeta' with 'solve' as it gave an error so %shortened variable 'zeta' to 'zet'; %3/ always produces a complex solution set for k, L and...
- Platform: Matlab, Scripts
- Design and Implementation of FIR Filter
- License: Shareware
- Price:


In this study, windowing-based Finite Impulse Response (FIR) filter design method is implemented for four regular filters ( Low Pass, Band Pass, Band Stop and High Pass). Detailed steps are described. The related codes are uploaded to the website of mathworks.com for sharing. Complete documentation is provided for repetition.
- Platform: Matlab, Scripts
- Find and return Binomial Coefficients (BCs) in a matrix up to N
- License: Shareware
- Price:


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 creating matrices of BCs and also has a basic integrity check to compare it with nchoosek. It can return 3 lots of data: comb,binTable, errorRate but you can just use it to find combinations by default.
- Platform: Matlab, Scripts
- Hypergeometric Probability Density Function (HPDF) - enhanced version
- License: Shareware
- Price:


myhygepdf2 - this second rendition of HPDF can now return a cumulative hpdf vector. EX4: [a,b]=myhygepdf2(1,40,5,36,'atleast') a = 1 b = 0.0001 0.0039 0.0690 0.4271 1.0000 This may enhance the usefulness of the function as you can avoid repeated calls to the function when cumulative probabilities are important to the user. The zipfile includes an updated 'binomind' function. This has also been uploaded separately.
- Platform: Matlab, Scripts
- Perfect Number Generator
- License: Shareware
- Price:


It calculates perfect even #'s with 2^(p-1)*(2^p - 1) where p and (2^p - 1) %are prime. A subsequent run yields a faster run-time. The code is fully %vectorized and hence cleaner than previous versions of the function. %NB: if (2^p - 1) is a Mersenne prime then a perfect number has been found. % %SYNTAX: >> perf_finalv4(P) % where P is an integer scalar in %useful inclusive range [2..31]. %i.e. run showing first 8 perfect numbers... %>> p = perf_finalv4(31); %>> [p(:,3)] % % ans = % % 6 % 28 % 496 % 8128 % 33550336 % 8589869056 % 137438691328 % 2.30584300813995e+018
- Platform: Matlab, Scripts
- Plot Wind Direction versus Wind Speed
- License: Shareware
- Price:


PLOTWINDIRVEL can be used to plot wind direction versus wind velocity (read strength) on a compass plot. I have included two scripts to show you how to use the function. If you run the first script make sure the datafile is co-resident with the two MATLAB-files. Here is a snippet from the second script: [a,b] = plotWinDirVel(wdir,knots, ... {'Wind Direction and Strength ...(zero degrees is true North)'}); You may need to vertically stretch the plots a little to reveal the heading. There is probably a better way to position the heading so feel free to offer suggestions.
- Platform: Matlab, Scripts
- Solves a custom set of linear simultaneous equations
- License: Shareware
- Price:


Fully documented script file but this essentially solves the simultaneous equations Yvonne presented in a previous thread and does so for two 1 x 4 vectors. I then built four graphs and displayed them all on one plot.
- Platform: Matlab, Scripts
- Solves a linear system of simultaneous equations (Sripts)
- License: Shareware
- Price:


simequation(a,b) a must be a n x n matrix of coefficients and b must be a n x 1 matrix of constants Example usage to solve this system of 2 simultaneous linear equations in 2 unknowns: 2x + 4x = 3 and 3x + 5x = 6 %coefficient matrix.. >> cm = [ 2 , 4; 3, 5] cm = 2 4 3 5 >> %..calling the function to solve the simultaneous linear equations...pass the constants as a column vector. >> simequation(cm,[3;6]) ans = 4.5000 -1.5000 % check answer >> cm * ans ans = 3.0000 6.0000
- Platform: Matlab, Scripts
- Solving non-linear (and linear) simultaneous equations with 'solve'
- License: Shareware
- Price:


symsolvesimulv2.m can be easily adapted to solve more equations but as it stands it will solve 2 unknowns in 2 non-linear equations (can be linear too or a mixture). Big change: It now has data input integrity checking. At the MATLAB command-line prompt you run the 'symsolvesimulv2' m-file function with the correct vector arguments i.e. exponents, coefficients and constants in the equations in the appropriate order. >> help symsolvesimulv2 solves a system (a pair) of non-linear or linear equations or a mixture, returning a n x 2 column solution vector for x and y. The first parameter is a row vector (1 x 4) of exponents used in both equations. An exponent of one for both terms indicates a linear equation. The second parameter (1 x 6) is also a row vector of all the coefficients and the constants used in both equations. The...
- Platform: Matlab, Scripts
- Solving non-linear and linear simultaneous equations with fsolve
- License: Freeware
- Price: 0.00


solvesimul.m can be easily adapted to solve more equations but as it stands it will solve 2 unknowns in 2 equations (1 non-linear and one linear). To solve equations of this form... a*x + b*y = A (1) a1*x^2 + b1*y^2 = B (2) ...with fsolve (used by solvesimul.m) you need to rewrite them so that they equal zero. so (1) and (2) become a*x + b*y - A = 0 (1a) a1*x^2 + b1*y^2 - B = 0 (2a) then using a nested function approach (there are many other ways) you can solve some system of non-linear equations. An example, 2*x + 3*y - 8 = 0 4*x^2 + 5*y^2 - 24 = 0 At the MATLAB command-line prompt you run the 'solvesimul' m-file function with the correct arguments i.e. coefficients and constants in the equations in the appropriate order. NB: please see final note below demo of the solvesimul command. >> b=solvesimul(2,3,4,5,8,24);...
- Platform: Matlab, Scripts
