tag:www.mathworks.com,2005:/matlabcentral/fileexchange/feedMATLAB Central File Exchangeicon.pnglogo.pngMATLAB Central - File ExchangeUser-contributed code library2015-05-28T12:13:51-04:00239121100tag:www.mathworks.com,2005:FileInfo/509952015-05-27T21:05:27Z2015-05-28T14:25:59ZVectorized Relaxation Algorithm For Solving Linear Partial Differential EquationsUtilizes a vectorized relaxation algorithm to solve linear partial differential equations.<p>This program utilizes a vectorized relaxation algorithm in order to solve linear partial differential equations. Please submit any suggestions you have for improving the program (I would eventually like to include a convergence constant in order to implement the SOR method).
<br />Example:
<br />%This is an example of how to use the program for a parallel plate capacitor with random point charges in the grid space:
<br />%sets a plot constant to plot data train every 100 loop counts
<br />plotk=100;
<br />%Here are the grid dimensions (note that the grid need not be square)
<br />L_xspan=150;
<br />L_yspan=150;</p>
<p>meshdim=1; %set the unit height of the grid points
<br />tol=10^(-7); %tolerance</p>
<p>%places the plates in the center of the grid with an x length 5
<br />plate1=L_xspan/2-5;
<br />plate2=L_yspan/2+5;</p>
<p>%separates the plates by 10 grid units
<br />position_plate1=L_yspan/2-5:L_yspan/2+5;
<br />position_plate2=L_yspan/2-5:L_yspan/2+5;</p>
<p>%creates the walls of the grid and capacitor plates
<br />Bound_0_x={1:L_xspan;1:L_xspan;1;L_xspan;plate1;plate2};
<br />Bound_0_y={1;L_yspan;1:L_yspan;1:L_yspan;position_plate1;position_plate2};</p>
<p>%sets the voltage of either plate
<br />v1=175;
<br />v2=-175;</p>
<p>%sets the values of the grid walls at zero and inserts the capacitor plate voltages
<br />Bound_0_val=[0;0;0;0;v1;v2];</p>
<p>%generates 5 random gridpoints
<br />Random_gridpoints=round(100*rand(2,5));</p>
<p>%generates 5 random potentials
<br />Random_potentials=round(100*rand(1,5));</p>
<p>%inserts initial values for the random potentials that were generated
<br />init_x={Random_gridpoints(1,1);Random_gridpoints(1,2);Random_gridpoints(1,3);Random_gridpoints(1,4);Random_gridpoints(1,5)};
<br />init_y={Random_gridpoints(2,1);Random_gridpoints(2,2);Random_gridpoints(2,3);Random_gridpoints(2,4);Random_gridpoints(2,5)};
<br />init_val=[Random_potentials(1,1);-Random_potentials(1,2);Random_potentials(1,3);Random_potentials(1,4);-Random_potentials(1,5)];</p>
<p>%calls the function
<br />[array_f,X,Y] = FDRelax(meshdim,L_xspan,L_yspan,Bound_0_x,...
<br /> Bound_0_y,Bound_0_val,init_x,init_y,...
<br /> init_val,tol,plotk);</p>Tyler Kossoverhttp://www.mathworks.com/matlabcentral/profile/authors/5188608-tyler-kossoverMATLAB 8.3 (R2014a)falsetag:www.mathworks.com,2005:FileInfo/509462015-05-22T04:47:21Z2015-05-28T13:55:44ZMass-Spring Under Friction and GravitySimulates the interaction of a spring and a mass. Gravity is a constant downwards acceleration.<p>Spring-Mass Under Friction and Gravity
<br />Simulink model created by Abdullah Baig at University of Engineering and Technology, Lahore.
<br />For suggestions, feedback and assistance, contact <a href="mailto:abdullahbaig1618@gmail.com">abdullahbaig1618@gmail.com</a>
<br />This Simulink model simulates the interaction of a spring and a mass. Gravity is implemented as a constant downwards acceleration. The system behaves like a pendulum if the spring-constant is sufficiently large.</p>
<p>Physical Entities
<br />There is an anchor, a mass and a spring in the simulation. The mass follows the Newton's laws of motion under the forces applied on it, i.e. the force exerted by the spring, the force due to the gravity and the force of friction. The spring connects the mass to the anchor and applies a force on the mass, depending on its position. All forces, accelerations, velocities and positions are 2-d vectors. The base units are cm, s and kg.</p>
<p>Mass
<br />The mass is made to follow the Newton's laws of motion and classical kinematics. The following equations are used to calculate its position from the forces acting on it.
<br />=> F = Mb*g - kf*v + Fb
<br />=> a = F / Mb
<br />=> v = Vb + int(F)
<br />=> Pos = Posb + int(v)
<br />Here, "F" is the total force acting on the mass, "Mb" is the value of the mass, "g" is the acceleration due to gravity, "kf" is the coefficient of friction, "v" is the instantaneous velocity of the mass, "Fb" is the external force acting on the mass, "a" is the instantaneous aceleration of the mass, "Vb" is the initial velocity of the mass, "Pos" is its instantaneous position, "Posb" is its initial position and int() denotes the integration function.</p>
<p>Spring
<br />The spring follows the Hooke's law with no limits. It takes the instantaneous position of the anchor and the mass and calculates the force exerted on the amss at that position. Its dynamics are defined using the following equations.
<br />=> L = sqrt((Posa-Posb).(Posa-Posb))
<br />=> e = L - Ls
<br />=> Fsb = ks * (Posa-Posb) * e / L
<br />Here, "L" represents the instantaneous length of the spring, "e" is the extension, "Ls" is the initial or natural length of the spring, "Fsb" is the force exreted by the spring on the mass, and "ks" is the spring contant of the spring.</p>
<p>Display
<br />The display block creates an animation of the anchor, the mass and the spring using their positions. The initial position of the mass is marked by a "+". The animation can also be exported to a video file named "output.avi".</p>Abdullah Baighttp://www.mathworks.com/matlabcentral/profile/authors/6549485-abdullah-baigMATLAB 7.8 (R2009a)falsetag:www.mathworks.com,2005:FileInfo/510042015-05-28T13:33:15Z2015-05-28T13:33:15Z2D Image cepstral analysisTwo dimensional cepstral spectrum.<p>The present function calculates the cepstral spectrum of image either gray scale or RGB colored. This spectrum is useful for analysis of an image and suitable for pre-processing of an image for machine learning purposes.</p>Pavel Paunovhttp://www.mathworks.com/matlabcentral/profile/authors/6500001-pavel-paunovMATLAB 8.2 (R2013b)MATLABfalsetag:www.mathworks.com,2005:FileInfo/510002015-05-28T11:52:25Z2015-05-28T11:52:25Zlsq_nonneg(X,A)lsq_nonneg<p>lsq_nonneg</p>Fatima Zohra BENHALOUCHEhttp://www.mathworks.com/matlabcentral/profile/authors/4911902-fatima-zohra-benhaloucheMATLAB 7.8 (R2009a)falsetag:www.mathworks.com,2005:FileInfo/509992015-05-28T11:22:04Z2015-05-28T11:28:51ZSpike_threshold_PS(trace,dt,win, win2, Fc,factordvdt)Estimating spike threshold in intracellular recordings from neurons.<p>Spike threshold detection alogrithm - Method I
<br /> This function calculates the spike threshold of a membrane potential
<br /> recording based on the method by Sekerli et al IEEE Trans Biom Eng
<br /> 51(9): 1665-1672, 2004. In this paper they suggest several methods of
<br /> estimating threshold. Here we use the first method, which is based on
<br /> revealing the threshold in a phase plot of V versus the derivative
<br /> dVdt. The largest positive slope is an indication of the threshold.</p>Rune W Berghttp://www.mathworks.com/matlabcentral/profile/authors/1338443-rune-w-bergMATLAB 8.3 (R2014a)falsetag:www.mathworks.com,2005:FileInfo/506672015-04-28T19:54:15Z2015-05-28T05:06:26ZD-RexOlivine LPO simulation<p># Drex #
<br />What is it?
<br />-----------------
<br />Drex simulates the rotation of crystal orientations and development of preferred orientations in a deforming olivine aggregate.</p>
<p>Motivation
<br />------------------
<br />The development of crystal preferred orientations in olivine (and other minerals) has important implications for understanding the dynamics of the earth's interior. Various computer models have been developed to simulate the rotation of crystal orientations in olivine aggregrates, but they have proven difficult to use. This is a version of the popular Drex model, implemented with user-friendliness in mind. </p>
<p>Requirements
<br />------------------
<br />Drex requires Matlab 2014 or later. No additional toolboxes are required to run the program. </p>
<p>Installation
<br />------------------
<br />No installation is necessary.</p>
<p>Usage
<br />------------------
<br />The code does not require input arguments and can be run by calling the program in the MATLAB command window or pushing the green "Run" button. User-adjustable parameters can be found in Drex.m. See the Drex.m file for additional information.</p>
<p>The Latest Version
<br />------------------
<br />Details of the latest version can be found on the github project page under
<br /> server project page under <a href="https://github.com/cthissen/Drex-MATLAB">https://github.com/cthissen/Drex-MATLAB</a></p>
<p>Contributors
<br />------------------
<br />Christopher Thissen, Yale University. <a href="mailto:christopher.thissen@yale.edu">christopher.thissen@yale.edu</a>
<br />with contributions from Mark Brandon, Yale University</p>
<p>Feedback
<br />------------------
<br />Your comments are welcome! If you find any bugs or have feature requests report them to
<br />Christopher Thissen, <a href="mailto:christopher.thissen@yale.edu">christopher.thissen@yale.edu</a>. </p>
<p>Issues can also be reported online: <a href="https://github.com/cthissen/Drex-MATLAB/issues">https://github.com/cthissen/Drex-MATLAB/issues</a></p>
<p>License
<br />------------------
<br />See License file.</p>Christopher Thissenhttp://www.mathworks.com/matlabcentral/profile/authors/1868168-christopher-thissenMATLAB 8.5 (R2015a)MATLABPlotting routines require Matlab 2014 or later.falsetag:www.mathworks.com,2005:FileInfo/236292009-04-11T12:28:01Z2015-05-28T05:06:06Zexport_figExports figures nicely to a number of vector & bitmap formats<p>This function saves a figure or single axes to one or more vector and/or bitmap file formats, and/or outputs a rasterized version to the workspace, with the following properties:
<br /> - Figure/axes reproduced as it appears on screen
<br /> - Cropped/padded borders (optional)
<br /> - Embedded fonts (pdf only)
<br /> - Improved line and grid line styles
<br /> - Anti-aliased graphics (bitmap formats)
<br /> - Render images at native resolution (optional for bitmap formats)
<br /> - Transparent background supported (pdf, eps, png)
<br /> - Semi-transparent patch objects supported (png only)
<br /> - RGB, CMYK or grayscale output (CMYK only with pdf, eps, tiff)
<br /> - Variable image compression, including lossless (pdf, eps, jpg)
<br /> - Optionally append to file (pdf, tiff)
<br /> - Vector formats: pdf, eps
<br /> - Bitmap formats: png, tiff, jpg, bmp, export to workspace
<br />
<br />This function is especially suited to exporting figures for use in publications and presentations, because of the high quality and portability of media produced.
<br />
<br />Note that the background color and figure dimensions are reproduced (the latter approximately, and ignoring cropping & magnification) in the output file. For transparent background (and semi-transparent patch objects), use the -transparent option, and set the axes 'Color' property to 'none' where desired. Pdf, eps and png are the only file formats to support a transparent background, while the png format alone supports transparency of patch objects.
<br />
<br />When exporting to vector format (pdf & eps), and to bitmap using the painters renderer, this function requires that ghostscript is installed on your system. You can download this from:
<br /> <a href="http://www.ghostscript.com">http://www.ghostscript.com</a>
<br />
<br />When exporting to eps it additionally requires pdftops, from the Xpdf suite of functions. You can download this from:
<br /> <a href="http://www.foolabs.com/xpdf">http://www.foolabs.com/xpdf</a>
<br />
<br />Usage examples and tips can be found in the README section at:
<br /> <a href="https://github.com/altmany/export_fig/blob/master/README.md">https://github.com/altmany/export_fig/blob/master/README.md</a>
<br />
<br />A technical description of the various components can be found here:
<br /> <a href="http://undocumentedmatlab.com/blog/export_fig">http://undocumentedmatlab.com/blog/export_fig</a>
<br />
<br />This submission was originally created by Oliver Woodford. Yair Altman maintains this utility since Jan 2015.
<br />
<br />When reporting bugs, please raise an issue via GitHub: <a href="https://github.com/altmany/export_fig/issues">https://github.com/altmany/export_fig/issues</a>
<br />Do not paste the error into the comments below - I will not respond to these.</p>Yair Altmanhttp://www.mathworks.com/matlabcentral/profile/authors/642467-yair-altmanMATLAB 8.4 (R2014b)MATLABGhostscript, Xpdf10889157431792820979236042870836391falsetag:www.mathworks.com,2005:FileInfo/499972015-03-12T23:21:13Z2015-05-28T05:06:01Ze0404/matRadA free multi-modality radiation treatment planning system<p>An open source multi-modality radiation treatment planning sytem</p>Mark Bangerthttp://www.mathworks.com/matlabcentral/profile/authors/1932532-mark-bangertMATLAB 8.3 (R2014a)MATLABfalsetag:www.mathworks.com,2005:FileInfo/475312014-08-13T09:53:09Z2015-05-28T05:05:36Zjosecamachop/MEDA-ToolboxMultivariate Exploratory Data Analysis Toolbox for Matlab<p>The Multivariate Exploratory Data Analysis (MEDA) Toolbox in Matlab is a set of multivariate analysis tools for the exploration of data sets. In the MEDA Toolbox, traditional exploratory plots based on Principal Component Analysis (PCA) or Partial Least Squares (PLS), such as score, loading and residual plots, are combined with new methods like MEDA, oMEDA and SVI plots. The latter are aimed at solving some of the limitations found in the former to
<br />adequately extract conclusions from a data set. Also, other useful tools such as cross-validation algorithms, Multivariate Statistical Process Control (MSPC) charts and data simulation/approximation algorithms (ADICOV) are included in the toolbox. Finally, most of the exploratory tools are extended for their use with very large data sets (Big Data), with unlimited number of observations.</p>Joséhttp://www.mathworks.com/matlabcentral/profile/authors/3921882-joseMATLAB 8.3 (R2014a)MATLABfalsetag:www.mathworks.com,2005:FileInfo/252912009-09-11T16:40:06Z2015-05-28T05:05:19ZRKN1210 - A 12th/10th order Runge-Kutta-Nyström integratorIntegrator for second-order ODE's with very stringent error tolerances.<p>RKN1210 12th/10th order Runge-Kutta-Nyström integrator
<br />RKN1210() is a 12th/10th order variable-step numerical integrator for ordinary differential equations of the form
<br /> y'' = f(t, y) (1)</p>
<p>with initial conditions</p>
<p> y(t0) = y0, y'(t0) = yp0 (2)</p>
<p>This second-order differential equation is integrated with a Runge-Kutta-Nyström method using 17 function evaluations per step. RKN12(10) is a very high-order method, to be used in problems with *extremely* stringent error tolerances. </p>
<p>The RKN-class of integrators is especially suited for problems of type (1). Compared to a classic Runge-Kutta integration scheme, the same accuracy can be obtained with fewer function evaluations. Also, it has been shown in various studies that this particular integration method is overall more efficient than (symplectic) multi-step or extrapolation methods that give the same accuracy.</p>
<p>RKN1210's behavior is very similar MATLAB's ODE-integrator suite; you can set options via ODESET, and input and output values are also practically the same. </p>
<p>Both output functions and event functions are fully supported.</p>
<p>The construction of RKN12(10) is described in
<br />High-Order Embedded Runge-Kutta-Nyström Formulae
<br />J. R. DORMAND, M. E. A. EL-MIKKAWY, AND P. J. PRINCE
<br />IMA Journal of Numerical Analysis (1987) 7, 423-430</p>
<p>Coefficients obtained from
<br /><a href="http://www.tampa.phys.ucl.ac.uk/rmat/test/rknint.f">http://www.tampa.phys.ucl.ac.uk/rmat/test/rknint.f</a>
<br />These are also available in any format on request to these authors. </p>
<p>If you find this work useful and want to show your appreciation:
<br /><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6G3S5UYM7HJ3N">https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6G3S5UYM7HJ3N</a></p>
<p></p>Rody Oldenhuishttp://www.mathworks.com/matlabcentral/profile/authors/1711536-rody-oldenhuisMATLAB 7.10 (R2010a)ODE suite, for ODESET() and ODEGET() (standard MATLAB)
false