Software Listing of Author : "Zachary Danziger"
- BestArrayDims
- License: Shareware
- Price:


[nr nc] = BestArrayDims(n) Given n elements, BestArrayDims returns the dimensions of an array in which to store them. The function also accepts user preferences as to whether they require less wasted space or a more square configuration. I have found this function particularly well-suited for finding subplot dimensions if it is not known in advance the number of plots that will be needed
- Publisher: Zachary Danziger
- Date Released: 24-06-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Discrete Frechet Distance
- License: Shareware
- Price:


The Frechet distance is a measure of similarity between two curves, P and Q. It is defined as the minimum cord-length sufficient to join a point traveling forward along P and one traveling forward along Q, although the rate of travel for either point may not necessarily be uniform. This algorithm calculates a bounded approximation of the Frechet distance using sampled points along curves P and Q.
- Publisher: Zachary Danziger
- Date Released: 14-01-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Hausdorff Distance
- License: Shareware
- Price:


The Hausdorff Distance is a mathematical construct to measure the "closeness" of two sets of points that are subsets of a metric space. Such a measure may be used to assign a scalar score to the similarity between two trajectories, data clouds or any sets of points. This function will (quickly) return the Hausdorff Distance of any two 2-dimensional sets of points. For more information on the Hausdorff Distance: http://en.wikipedia.org/wiki/Hausdorff_distance
- Publisher: Zachary Danziger
- Date Released: 24-06-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Iterated Prisoner's Dilemma
- License: Shareware
- Price:


The iterated prisoner's dilemma (IPD) game has long been studied in game theory, economics, programming, decision theory and other fields. It is a 2-player scenario where each player must decide to either 'cooperate' or 'defect' in a sequence of games, and their respective choices determine the relative success or failure of each player. Will you cooperate with your opponent or look to steal all the points for yourself? This code runs a tournament among two or more players. Each player may submit as many "personalities" as they wish. Each personality submitted by each player plays the IPD game against all personalities submitted by all other players. Results are then plotted and outputted. An example has already been set up in this submission among 3 example players and a number of simple sample personalties for each player. To...
- Publisher: Zachary Danziger
- Date Released: 08-02-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Mesmerize
- License: Shareware
- Price:


Mesmerize is largely a tribute to the many-faceted plotting features of MATLAB. Call this function to be entertained by exciting figures that always have subtle new elements and amusing titles. Don't let your frustrating day get the best of you, use this function and remember how aesthetic MATLAB can be. >> help Mesmerize Mesmerize(time) Produces mezmorizing figures for time seconds.
- Publisher: Zachary Danziger
- Date Released: 13-06-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Swap structure values into strings
- License: Shareware
- Price:


Searches a string for field names contained in a given structure, then replaces each occurrence of the field name with the corresponding field value. I use this for dynamically changing the titles on my plots during simulations that require variation of parameters. Code for title in the image: % normal use (line 2) >> q.mu = 0; q.theta = 2; q.sig = 0.3; >> utitle{2} = struct2strrep(q,'dI_n/dt = q.theta(q.mu-I_n)dt + 2*q.sigWsurddt'); % use with an anonymous function (line 1), useful when both a function and parameter are changing >> p.A = 1.6; p.f = 50/1000; p.dc = 0; >> Ia = @(t,p) p.dc + p.A *sin( 2*pi* p.f *t ); >> utitle{1} = struct2strrep(p,['I_a = ' strrep(func2str(Ia),'@(t,p)','') ' mA']);
- Publisher: Zachary Danziger
- Date Released: 14-05-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Symbolic Matrix
- License: Shareware
- Price:


A matrix of symbolic elements is reasonably useful for many analytic linear algebra applications, and for analytic vector, matrix and tensor differentiation. This function produces a matrix of arbitrary dimension of symbolic elements that are indexed by their position in the symbolic matrix for ease of reference. EXAMPLE >> M = symMat([2 2],'m','real') M = [ m11, m12] [ m21, m22] >> class(M) ans = sym >> det(M) ans = m11*m22 - m12*m21
- Publisher: Zachary Danziger
- Date Released: 01-03-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Text Yahtzee
- License: Shareware
- Price:


Object: Roll dice for scoring combinations and get the highest total score. This text-based command window Yahtzee game was inspired by a few of the other submissions on this site. This version has the following features: - High scores list - Multi-player versus option - Stable, pleasing and intuitive interface - Conforms to all official Yahtzee rules (including bonus Yahtzee joker scoring: http://www.hasbro.com/common/instruct/Yahtzee.pdf) - Short, modular, commented code (usefull for editing and following flow) - Consice and transparent score allocation logic - Text-only game mechanics makes it look like you're working >> ZYahtzee % runs game >> ZYahtzee(p) % runs game for p players Enjoy a brief game of Yahtzee!
- Publisher: Zachary Danziger
- Date Released: 17-05-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Vectorized Transpose Matrix
- License: Shareware
- Price:


The vectorized transpose matrix, Tmn, is the matrix that permutes the vectorization of an m#n matrix A into its transpose vectorization. For example, if the vectorization of A is defined as vec(A), or A(:), then Tmn*vec(A) = vec(A'). EXAMPLE The vectorized transpose matrix can be used to reverse the order of arguments to the otherwise non-commutative Kronecker product. >> m=2;n=3;p=4;q=2; >> A = rand(m,n); B = rand(p,q); >> isequal(TvecMat(p,m)*kron(A,B)*TvecMat(n,q),kron(B,A)) ans = 1 For other useful properties of the vectorized transpose matrix, see: http://www.ee.ic.ac.uk/hp/staff/dmb/matrix/special.html#VecTranspose ://http://www.ee.ic.ac.uk/hp/staff/dmb...l#VecTranspose
- Publisher: Zachary Danziger
- Date Released: 12-03-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts