Software Listing of Author : "Michael Kleder"
- CON2VERT - constraints to vertices
- License: Freeware
- Price: 0.00


CON2VERT - convert a convex set of constraint inequalities into the set of vertices at the intersections of those inequalities;i.e., solve the "vertex enumeration" problem. V = con2vert(A,b) Converts the polytope (convex polygon, polyhedron, etc.) defined by the system of inequalities A*x <= b into a list of vertices V. Each ROW of V is a vertex. For n variables: A = m x n matrix, where m >= n (m constraints, n variables) b = m x 1 vector (m constraints) V = p x n matrix (p vertices, n variables) NOTES: (1) This program emplyes a primal-dual polytope method. (2) In dimensions higher than 2, duplicate vertices can appear using this method. This program detects duplicates at up to twelve digits of precision, then returns the unique vertices. (3) Non-bounding constraints give erroneous results; therefore, the program detects...
- Publisher: Michael Kleder
- Date Released: 05-06-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Convert Cartesian (ECEF) Coordinates to lat, lon, alt
- License: Freeware
- Price: 0.00


ECEF2LLA - convert earth-centered earth-fixed (ECEF) cartesian coordinates to latitude, longitude, and altitude. USAGE: [lat,lon,alt] = ecef2lla(x,y,z) lat = geodetic latitude (radians) lon = longitude (radians) alt = height above WGS84 ellipsoid (m) x = ECEF X-coordinate (m) y = ECEF Y-coordinate (m) z = ECEF Z-coordinate (m) Notes: This function assumes the WGS84 model. Latitude is customary geodetic (not geocentric). Michael Kleder, April 2006
- Publisher: Michael Kleder
- Date Released: 10-04-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Create Non-overlapping (cascading) Figure Windows
- License: Shareware
- Price:


FIGUREC - create a figure window in a non-overlapping (cascading) location USAGE: figurec figurec(...) h=figurec h=figurec(...) FIGUREC acts just like the MATLAB FIGURE command, with all arguments passed through, except that the new figure is created a little to the right and down from the highest numbered figure currently existing, so that they won't overlap. If moving the location would push the figure too close to the edge of the screen, then the new figure is created in the default location as usual. (Subsequent figures will again be cascaded.) An optional figure handle is returned according to the usual FIGURE calling syntax. EXAMPLE: close all for n=1:20 figurec('color',rand(1,3)) plot(0,0);title('Sample') end
- Publisher: Michael Kleder
- Date Released: 24-02-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- EPRIMES
- License: Shareware
- Price:


Recently, Google Inc. created a few highway billboard signs asking passersby to find the first ten-digit prime within consecutive digits of e. Certainly the Mathworks File Exchange must address such a challenge! Unfortunately, the answer to the Google billboard question was quickly published in the media, so the answer is readily available. Nevertheless, if you wish to solve the problem yourself, please feel free to ignore those publications and this program. This program begins with the first one-digit prime and continues locating larger and larger primes. The program has an arbitrary stoping point at 500 digits. Also, to save space there are only 10,000 stored digits of e, so there is a limit (much larger than 500) to how large your desired prime can be using this code. Probable prime calculations are employed using Java. (See...
- Publisher: Michael Kleder
- Date Released: 13-02-2013
- Download Size: 20 KB
- Download
- Platform: Matlab, Scripts
- Geodetic distance on WGS84 earth ellipsoid
- License: Freeware
- Price: 0.00


In 1975, Vincenty published a rapidly converging algorithm for computing the distance between points on an ellipsoidal earth. The algorithm is precise to within a few millimeters. Since then, his algorithm has since seen significant implementation in geodesy and engineering. After adjusting the algorithm to converge in all cases (the original suffers from convergence failure in a few outlying cases), I have provided it here in MATLAB form. The function itself does not require the Mapping Toolbox, but I have included a (commented-out) code section following the body of the function, which you can use if you have the Mapping Toolbox to compare the accuracy of this algorithm to spherical earth distances. Note that in that toolbox, the Mathworks uses a fast but somewhat less precise method for computing geodetic distances on an ellipsoid....
- Publisher: Michael Kleder
- Date Released: 04-05-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- How fast is your graphics card?
- License: Shareware
- Price:


An approximately 800-faceted reflective polyhedron is created, subjected to multicolor light sources, and set to rotating. On my 2 GHz laptop, I get 1.6 rotations per minute. Can your computer beat my laptop?
- Publisher: Michael Kleder
- Date Released: 25-04-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Interactive GUI: Animated conic section through five points
- License: Shareware
- Price:


(1) Use the mouse to click and drag the red data points within the dotted gray box, and observe the changes in the conic section in real time. (2) This function requires the symbolic math toolbox and is tested using Matlab version 7.1 (R14) service pack 3. (3) This function illustrates some techniques in GUI manipulation, computation of a conic-sections using the general determinant expression, and the "ezplot" function. Nevertheless, the code is developmental and hasn't been polished or heavily commented. (4) "ezplot" is a really handy function, but it was not designed for speed. Using it repeatedly for animation slows things down enough for older machines to exhibit some lag in the animation. (5) Parabolas require exact point placement. It is highly unlikely that you will get a parabola after the initial startup. (6) Tested but no...
- Publisher: Michael Kleder
- Date Released: 19-03-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- jQuery.relatizeDate
- License: Freeware
- Price: 0.00


SHPATH - shortest path with obstacle avoidance (ver 1.3) Given a "terrain" matrix consisting of zeros (for open space) and ones (for obstacles), this function computes the shortest path between two specified points while avoiding obstacles. A two-stage solution is employed. In stage one, the algorithm rapidly propagates through all possible pathways to find a representative shortest route. In stage two, the path is contracted to follow closely around sharp corners and eliminate quantization noise. Although the map coordinates (and intial and final points) are integers, the solution coordinates are reals to allow for the elimination of jitter from map quantization. Note that diagonal "moves" ARE allowed. To avoid confusion over X/Y conventions for grid matrices, the issue is avoided entirely by referring only to the row and column...
- Publisher: Michael Kleder
- Date Released: 19-01-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- NOREDUND - remove redundant linear constraints or inequalities
- License: Freeware
- Price: 0.00


NOREDUND - Remove redundant linear inequalities from a set of inequalities; i.e., remove redundant linear constraints defining a feasible region. Note that the feasible region satisfies A*x <= b, where A is a fixed matrix, b is a fixed vector, and x is the vector of coordinates in your space; i.e., all values of x (or equivalently, all ordered n-tuples of coordinate numbers) which satisfy the inequality A*x <= b are inside the feasible region (or on its boundary). Removing redundant constraints means removing rows of A and the corresponding entries in b which are not necessary, which then leaves a new inequality An*x <= bn. Since the number of columns in A and An is the same (equal to the number of rows in x, or equivalently to the dimensionality of your space), the dimensionality of the problem is unchanged. Rather, the...
- Publisher: Michael Kleder
- Date Released: 21-02-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Puzzle: visualize the 3-D cube in that Tickle IQ puzzle (surprising result)
- License: Shareware
- Price:


Recently, the folks at http://web.tickle.com sent out an advertisement where you have to assemble a cube in 3-D in your mind from a flat drawing, and then decide which of several drawn cubes match the truth. I won't give the answer away here, but the included MATLAB figure file provides the cube rendered in 3-D so you can spin it around and decide for yourself. Use "hgload cube" (or "hgload cube6" if you have a MATLAB version prior to MATLAB 7). Spin the cube around and play with it. Make sure that you check the rendered cube for correct placement of the graphics on the faces, INCLUDING THE ORIENTATION OF EACH GRAPHIC. (That's the detail that gives the surprising result!) Caution: Users may give the answer in the comments below (in fact I encourage it). So if you want to solve the puzzle, do so before you read the comments. Enjoy,...
- Publisher: Michael Kleder
- Date Released: 19-05-2013
- Download Size: 225 KB
- Download
- Platform: Matlab, Scripts
- quadprog2 - convex QP solver
- License: Freeware
- Price: 0.00


QUADPROG2 - Convex Quadratic Programming Solver Featuring the SOLVOPT freeware optimizer New for version 1.1: * Significant speed improvement * Geometric Preconditioning * Improved Error Checking USAGE: [x,v] = quadprog2(H,f,A,b) [x,v] = quadprog2(H,f,A,b,guess) [x,v,opt] = ... Minimizes the function v = 0.5*x'*H*x + f*x subject to the constraint A*x <= b. Initial guess is optional. ("opt" returns SOLVOPT data for advanced use. Details are available in the SOLVOPT documentation at the website identified below.) Notes: (1) For a problem with 100 variables and 300 constraints, you will often get a result in under 5 seconds. However, sometimes the optimizer has to work longer (see below) for difficult optimizations. Alerts are provided. (Note: The calculation time is more sensitive to the number of variables than it is to the...
- Publisher: Michael Kleder
- Date Released: 17-06-2013
- Download Size: 31 KB
- Download
- Platform: Matlab, Scripts
- SATGLOBE - Rendering Satellite Views of Earth
- License: Freeware
- Price: 0.00


SATGLOBE - This file renders a fully manipulatable satellite view of earth at a resolution of two pixels per degree, with added international political boundaries and gridlines. The imagery was obtained from NASA, and the globe was rendered using the MATLAB Mapping Toolbox. The Mapping Toolbox is not needed to use this file. In order to save storage space, this m-file loads image data from the file satglobe.mat, and then creates the graticule mesh itself. This process allows users who do not have the MATLAB Mapping Toolbox to render the figure, but it does take a few moments to compute the mesh. Using this trick, the data storage is reduced considerably; however, once the figure is rendered, you may wish to save it as a regular MATLAB figure file to increase speed. Notes: (1)The uploaded zip file contains the satglobe.m file which...
- Publisher: Michael Kleder
- Date Released: 12-03-2013
- Download Size: 461 KB
- Download
- Platform: Matlab, Scripts
- SATGLOBE4 - Visualizing Earth from Space: 3-D Rendering of NASA Satellite Imagery
- License: Freeware
- Price: 0.00


SATGLOBE4 - This file is a higher-resolution version of "SATGLOBE," provided at the request of several users. SATGLOBE4 renders a fully manipulatable satellite view of earth at a resolution of four pixels per degree, with added international political boundaries and gridlines. The imagery was obtained from NASA, and the globe was rendered using the MATLAB Mapping Toolbox. The Mapping Toolbox is not needed to use this file. In order to save storage space, this m-file loads image data from the file satglobe4.mat, and then creates the graticule mesh itself. This process allows users who do not have the MATLAB Mapping Toolbox to render the figure, but it does take a few moments to compute the mesh. Using this trick, the data storage is reduced considerably; however, once the figure is rendered, you may wish to save it as a regular MATLAB...
- Publisher: Michael Kleder
- Date Released: 20-02-2013
- Download Size: 1249 KB
- Download
- Platform: Matlab, Scripts
- SEP - An Algorithm for Converting Covariance to Spherical Error Probable
- License: Freeware
- Price: 0.00


This function computes Spherical Error Probable radius from inputs consisting of the square roots of the eigenvalues of a covariance matrix (equivalently, from sigma-x, sigma-y, and sigma-z, of a trivariate normal distribution in a coordinate system where there is no cross-correlation between variables.) This means that if you have a covariance matrix and wish to compute the S.E.P., simply obtain the square roots of the eigenvalues and use these as inputs. For example, list them via "sqrt(eig(C))" where C is your covariance matrix. The S.E.P. is the radius of a sphere which contains a fraction of probability equal to the input "prob," which is asumed to be 0.5 if omitted. Note: if one of the input sigmas is significantly smaller than both others, calculation time may rise. By uncommenting a labeled line of code, the user can enter a...
- Publisher: Michael Kleder
- Date Released: 06-02-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Shortest Path with Obstacle Avoidance
- License: Shareware
- Price:


SHPATH - shortest path with obstacle avoidance (ver 1.3) Given a "terrain" matrix consisting of zeros (for open space) and ones (for obstacles), this function computes the shortest path between two specified points while avoiding obstacles. A two-stage solution is employed. In stage one, the algorithm rapidly propagates through all possible pathways to find a representative shortest route. In stage two, the path is contracted to follow closely around sharp corners and eliminate quantization noise. Although the map coordinates (and intial and final points) are integers, the solution coordinates are reals to allow for the elimination of jitter from map quantization. Note that diagonal "moves" ARE allowed. To avoid confusion over X/Y conventions for grid matrices, the issue is avoided entirely by referring only to the row and column...
- Publisher: Michael Kleder
- Date Released: 12-04-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- VDISTINV: Find the endpoint of a geodesic on the ellipsoidal earth
- License: Freeware
- Price: 0.00


This function solves the "forward geodesic problem," which is to compute the endpoint of a geodesic (shortest-distance) path on the ellipsoidal earth, given the start point, a path length, and a starting azimuth. In response to a user request, this function numerically inverts the previously published VDIST function, which is contained within. (VDIST solves the "inverse geodesic problem" of computing the distance and azimuth between two known points, using Vincenty's 1975 algorithm.) Although numerically inverting VDIST is not a very efficient way to solve the forward problem, it provides a quick solution and also serves as an example of how to invert a function numerically in Matlab. OTHER NOTES: The distance between essentially antipodal points on an ellipsoid is very sensitive to small deviations in azimuth, so such points should...
- Publisher: Michael Kleder
- Date Released: 08-04-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- VERT2CON - vertices to constraints
- License: Freeware
- Price: 0.00


VERT2CON - convert a set of points to the set of inequality constraints which most tightly contain the points; i.e., create constraints to bound the convex hull of the given points [A,b] = vert2con(V) V = a set of points, each ROW of which is one point A,b = a set of constraints such that A*x <= b defines the region of space enclosing the convex hull of the given points For n dimensions: V = p x n matrix (p vertices, n dimensions) A = m x n matrix (m constraints, n dimensions) b = m x 1 vector (m constraints) NOTES: (1) In higher dimensions, redundant constraints can appear. This program detects redundancy at 6 digits of precision (per dimension), then returns the unique constraints. (2) See companion function CON2VERT. (3) ver 1.0: initial version, June 2005. (4) ver 1.1: enhanced redundancy checks, July 2005 (5) Written by...
- Publisher: Michael Kleder
- Date Released: 23-01-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- WGS84 Ellipsoidal Earth Plotted at 4 pixels Per Degree
- License: Freeware
- Price: 0.00


SATGLOBE4e - Draws an idealized satellite view of earth scaled to match the WGS84 ellipsoid. This file renders a fully manipulatable satellite view of earth at a resolution of four pixels per degree, with added international political boundaries and gridlines. The imagery was obtained from NASA, then postprocessed. The globe was rendered using the MATLAB Mapping Toolbox. The Mapping Toolbox is not needed to use this file; however, if you have the toolbox, you will be able to use the plot3m command to add your own graphics. If not, you can simply use plot3. (In both cases, keep in mind the WGS84 scaling.) In order to save storage space, this m-file loads image data from the file satglobe.mat, and then creates the graticule mesh itself. This process allows users who do not have the MATLAB Mapping Toolbox to render the figure, but it...
- Publisher: Michael Kleder
- Date Released: 06-05-2013
- Download Size: 1260 KB
- Download
- Platform: Matlab, Scripts
- Windows command line MATLAB process priority
- License: Freeware
- Price: 0.00


I've seen many questions on how to run MATLAB in Windows with a process priority other than "normal." During long calculations on single-processor machines, it would be nice to reduce the priority of the MATLAB process so that you can get other work done. Also, it would be nice to set the priority to "realtime" for benchmarking. The attached text file gives very simple directions for setting this up in windows. It's just text, but you'll need to download the attached file in order to obtain the instructions for two reasons: (1) so that the instructions are easier to cut-and-paste as needed. (2) so that the Mathworks can keep track of the number of people who are interested in this topic. (I have tested this on Windows XP, but it is supposed to work on Windows NT and Windows 2000 as well.)
- Publisher: Michael Kleder
- Date Released: 03-01-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
