This is a nice interactive tool to study first order ODEs, which was originally created by John Polking at Rice University (together with other tools such as pplane and odesolve).The original versions (see also here https://math.rice.edu/~polking/odesoft/solver.html for more information) only work up to MATLAB versions R2014a. A great version of pplane8 which works in any MATLAB version can be found here: https://www.mathworks.com/matlabcentral/fileexchange/61636-pplaneNote that at the time of writing there are a couple of versions on file exchange (both called dfield9) from Gerardo Garcia (https://www.mathworks.com/matlabcentral/fileexchange/64437) and Iourii Kouznetsov (https://www.mathworks.com/matlabcentral/fileexchange/65886), however the former gives warnings for versions 2015a and later, and errors out for versions 2017b and later. The latter works without errors or warnings, but the text is disproportionally larger and out of place. Both versions have the toolbar on in the setup window and tend to place the display window a little out of reach in the upper right part of the screen sometimes.This version of dfield8 is the closest to the original in look and feel, but it is faster, and it works for any version from R2014b on.

Run 'designMPPTboost.m' only. Other files is a support file.It is based on the research paper:R. Ayop and C. W. Tan, "Design of boost converter based on maximum power point resistance for photovoltaic applications," Solar Energy, vol. 160, pp. 322-335, 15 January 2018.Simplified:It is a MATLAB Graphical User Interface to calculate inductance and capacitance for the MPPT boost converterhttps://youtu.be/xBftvw3MnwwDetails:The design of the boost converter for the maximum power point tracking (MPPT) is complex due to the nonlinear characteristics of Photovoltaic (PV) modules. In addition, PV modules are irradiance and temperature dependent, which further increases the complexity of the boost converter design. This paper proposes a new approach that eases the design of the boost converter specifically for MPPT applications. This approach represents the maximum power point of the PV module as resistance to simplify the boost converter design, which specifies the design according to the PV module parameters. The derived equations require nine parameters to determine the inductance, input capacitance, and output capacitance of the MPPT boost converter. In this paper, the single diode PV model and the hill climbing MPPT algorithm have been applied in the simulation using MATLAB/Simulink®. The results show that the simulations of the boost converter followed the desired requirements. This proves that the calculated inductance, input capacitance, and output capacitance using the proposed method are accurate.

IMPORTANT: Download the .zip package in order to get the .mat locations of the default channels.The 'plot_topography' function plots a topographical EEG/MEG map of the head over the desired points (ch_list) and their assigned (values). Note that the channels must be introduced according to their names, following the 10-10, 10-20 or the Yokogawa system. If you want to use custom locations, you must indicate the path of a locations.mat file (see the header of the function for further instructions).Input parameters:- ch_list: Channel list in cell-array. Use the string 'all' for displaying all channels available. Note that 'z' indicator should be in lower case. Example: ch_list = {'Fpz','Fz','Cz','Pz','Oz'};- values: Numeric vector that contains the values assigned to each channel.- make_contour: (Optional, default: false) Boolean that controls if the contour lines should be plotted.- system: (Optional) Measurement system as a string: '10-20' (default), '10-10', 'yokogawa', custom path or table.- plot_channels: (Optional, default: false) Boolean that controls if the electrodes should be plotted.- plot_clabels: (Optional, default: false) Boolean that controls if the text labels of each electrode should be plotted.- INTERP_POINTS:(Optional, default: 1000) No. of interpolation points. The lower N, the lower the resolution and the faster the computation. Example of use:plot_topography('all', rand(1,81));

The REMD is an improved empirical mode decomposition powered by soft sifting stopping criterion (SSSC). The SSSC is an adaptive sifting stop criterion to stop the sifting process automatically for the EMD. It extracts a set of mono-component signals (called intrinsic mode functions) from a temporal mixed signal. It can be used together with Hilbert transform (or other demodulation techniques) for advanced time-frequency analysis.

Generates the roto-translation matrix for the rotation around an arbitrary line in 3D. The line need not pass through the origin. Optionally, also, applies this transformation to a list of 3D coordinates. SYNTAX 1: M=AxelRot(deg,u,x0) in: u, x0: 3D vectors specifying the line in parametric form x(t)=x0+t*u Default for x0 is [0,0,0] corresponding to pure rotation (no shift). If x0=[] is passed as input, this is also equivalent to passing x0=[0,0,0]. deg: The counter-clockwise rotation angle about the line in degrees. Counter-clockwise is defined using the right hand rule with respect to the line direction vector u. out: M: A 4x4 affine transformation matrix representing the roto-translation. Namely, M will have the form M=[R,t;0 0 0 1] where R is a 3x3 rotation and t is a 3x1 translation vector. SYNTAX 2: [R,t]=AxelRot(deg,u,x0) Same as Syntax 1 except that R and t are returned as separate arguments. SYNTAX 3: This syntax requires 4 input arguments be specified, [XYZnew, R, t] = AxelRot(XYZold, deg, u, x0) where the columns of the 3xN matrix XYZold specify a set of N points in 3D space. The output XYZnew is a 3xN matrix of transformed points, i.e., the input points rotated about the axis. All other input/output arguments have the same meanings as before.

Supercolorbar draws a custom colorbar with different tick styles and end shapes.supercolorbar(pos,cm,ticks)supercolorbar(pos,cm,ticks,Name,Value)

MATLAB code to compute the friction factor in pipes for given values of the Reynolds number (Re) and the relative roughness coefficient (epsilon).Syntax: f = colebrook(Re,epsilon)Example 1: Single Re, single epsilon Re = 1e5; epsilon = 1e-4; f = colebrook(Re,epsilon)Example 2: Multiple Re, single epsilon Re = 5000:1000:100000; epsilon = 1e-4; f = colebrook(Re,epsilon); plot(Re,f)Example 3: Single Re, multiple epsilon Re = 1e5; epsilon = linspace(1e-4,1e-1,100); f = colebrook(Re,epsilon); plot(epsilon,f)Example 4: Multiple Re, multiple epsilon Re = logspace(4,8,100); epsilon = linspace(1e-4,1e-1,100); [RE,EPSILON] = meshgrid(Re,epsilon); F = colebrook(RE,EPSILON); surf(RE,EPSILON,F)References: [1] Colebrook, C. F., & White, C. M. (1937). Experiments with fluid friction in roughened pipes. Proceedings of the Royal Society of London. Series A - Mathematical and Physical Sciences, 161(906), 367-381. [2] Colebrook, C. (1939). Turbulent Flow in Pipes, with Particular Reference to the Transition Region between the Smooth and Rough Pipe Laws. Journal of the Institution of Civil Engineers, 11(4), 133-156.

This is a 3D extension of leafpile.m and includes to ability to add physics (currently the HW assignment for my Differential Equations students). As is, the code just lets gravity act alone on the leaves.This code takes advantage of Hamid Naderi Yeganeh's wonderful parametric curves that describe oak and maple leaf shapes [1] and MATLAB's built-in Autumn colormap.After using some randomization on the colors chosen within the colormap, the leaf coordinates, roll, pitch, and yaw, we have ourrselves a nice little leaf pile generator! Why wait until Mid October when you can experience those beautiful few weeks all year round within the comfort of your MATLAB console?This code will be updated with some realistic drag laws after my students' HW assignment is due. I'd also like to eventually incorporate some slider controls like Sean de Wolski did for the 2D leafpile code last year. [1] Hamid Naderi Yeganeh, Scientific American, March 16 2017, https://blogs.scientificamerican.com/guest-blog/how-to-draw-with-math/

Walk-thru video below, for a previous version. There's some spoken mistakes, but the code should run okay. https://youtu.be/taDSfV2a3J8

This function computes sunrise and sunset times from any location on Earth (latitude, longitude and altitude), for a given date and timezone. The function is fully vectorized so any input parameters can be scalars, vectors or matrix (of the same size).Without any argument, sunrise will try to guess your location (needs internet connection).NEW: It is also possible to use two reverse functions:- from the day length, it computes the corresponding latitude;- from sunrise and sunset date/time it computes the corresponding latitude and longitude.Both reverse function need altitude as input argument.Examples:To get sunrise/sunset of your current location: >> sunrise Location: 48.8582 °N, 2.3387 °E, 0 m Sunrise: 10-Oct-2017 08:03:41 +02 Sunset: 10-Oct-2017 19:13:49 +02 Day length: 11h 10mn 8sTo compute the latitude corresponding to 14h of daylight at altitude 0m on April 21, 2019: >> sunrise(14/24,0,'2019-04-21','day2lat') Estimated latitude: 49.076°NTo compute the latitude and longitude corresponding to specific sunrise and sunset times: >> sunrise('22-Apr-2019 04:52:12','22-Apr-2019 18:51:04',0,'sun2ll') Estimated location: 47.9995°N, 2.00142°EType help sunrise or doc sunrise to get syntax and full documentation. See the function code for further explanations.

% Interactive Zoom plot% [p_ax,ch_ax]= ZoomPlot()% [p_ax,ch_ax]= ZoomPlot(p_ax)%% This function allow you draw zoomed/magnified axes on a existing axes.% The funciton gets its axes handle from gca() when called with no input% arguments. This function should work for all 2D linear axes plots like% plot(), scatter(), quiver().%% INPUTS:% p_ax - parent axes handle%%OUTPUTS:% p_ax: handle of the parent axes% ch_ax: handle of the child/Zoom axes%% Example 1: simple% x = linspace(0,3*pi,200);% y = [cos(x) + rand(1,200);cos(x+1) + rand(1,200)]; % figure,plot(x,y),title('Noisy cosines'),xlabel('x'),ylabel(y)% ZoomPlot();% %Follow the instructions on the title of the plot%% Example 2: create multiple zoomed axes and playing with handles% x = linspace(0,3*pi,200);% y = [cos(x) + rand(1,200);cos(x+1) + rand(1,200)]; % figure,plot(x,y),title('Noisy cosines'),xlabel('x'),ylabel(y)% p_ax=gca;% [p_ax,ch_ax1]=ZoomPlot(p_ax);% %follow the instruction on the title of the plot% [p_ax,ch_ax2]=ZoomPlot(p_ax);% % set title and other properties with handle% legend(p_ax,{'Cos','Shifted cos'})% title(ch_ax1,'1st zoom plot')% set(ch_ax1,'LineWidth',1.5,'XColor',lines(1),'YColor',lines(1))% title(ch_ax2,'2nd zoom plot')Similar plotting function:https://in.mathworks.com/matlabcentral/fileexchange/59857-zoomplotKnown Issues:v1.1.0: Size of zoom axes is scaled down during interaction for moving and resizing zoom axes ROI

dark mode plotTransform your MATLAB plots to fit dark mode theme backgrounds! The function test which of the figure colors are not suitable to be used over a dark background (via color contrast), and adjust colors accordingly using a desaturation and brightness approach. In addition, it transforms the relevant Matlab figure attributes, such as axis and text colors, and figure background. The result is a transformed figure that can be copied to a dark mode theme presentation or website.Preparing this function I was inspired by https://material.io/design/color/dark-theme.htmlHow to use the function:generate or import a Matlab figure and run the function, for example: plot(bsxfun(@times,[1:4],[2:5]'));xlabel('X');ylabel('Y'); plot_darkmodeCopy the figure from the clipboard using Edit>Copy Figure and paste it on top of the dark background theme, for example in PowerPoint. Make sure that in the Copy Option, the Transparent Background is enabled. The function was tested with Matlab 2019b - Win10.To Do:write a version of the sub function adjust_color to adjust colormaps based on similar reasoning, (or replace colormaps?)

* * * NOTICE * * * A NEW AND IMPROVED VERSION OF THIS FUNCTION CAN BE FOUND IN THE CLIMATE DATA TOOLBOX FOR MATLAB. GET IT HERE: https://www.mathworks.com/matlabcentral/fileexchange/70338This function returns linear least-squares slopes along any dimension of any N-dimensional data set. The function was designed with large 3D netCDF climate reanalysis data sets in mind, but it will also work data sets of smaller or larger dimensions. This function is much faster and cleaner than the common method of nesting loops, for example, to solve for each lat and lon or each x and y. An example of how one might use this function is shown in the image at the top of this page. To create this image I used daily surface wind and sea surface temperature fields (ECMWF ERA-Interim) from 1990 through 1999 to solve for trends in SST, zonal wind, and meridional wind. In the 90s, the sea surface cooled around most of Antarctica, but warmed in the Weddell sea, where the meridional component of surface winds strengthened. SYNTAX: s = trend(A) s = trend(A,Fs) s = trend(A,t) s = trend(...,dim) s = trend(A,[],dim) [s,int] = trend(...)DESCRIPTION: s = trend(A) returns the (N-1)-dimensional matrix s corresponding to the linear trend(s) along dimension 1 of A. Assumes data are evenly spaced along dimension 1. s = trend(A,Fs) declares sampling frequency Fs along trending dimension of A. s = trend(A,t) allows for unevenly-spaced data in the trending dimension with time vector t. length of t must equal the length of A along its trending dimension. s = trend(...,dim) returns the trend along dimension dim of A. s = trend(A,[],dim) assumes data are sampled at 1 Hz or 1/(unit time) or 1/(unit space), etc. [s,int] = trend(...) also returns the intercepts of the slope-intercept form.The header of the function contains several usage examples.

Computes the B-spline approximation from a set of coordinates (knots).The number of points per interval (default: 10) and the order of the B-spline (default: 3) can be changed. Periodic boundaries can be used.It works on any dimension (even larger than 3...).This code is inspired from that of Stefan Hueeber and Jonas Ballani [1].Example (see image):%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%rng(1) % Set random seed for reproductility XY=rand(5,2); % Random set of 5 points in 2D BS2=BSpline(XY); % Default order=3 (quadratic) BS3=BSpline(XY,'order',4); % order=4 -> cubic B-splineBSper=BSpline(XY,'periodic',true);h=plot(XY(:,1),XY(:,2),'-o',BS2(:,1),BS2(:,2),BS3(:,1),BS3(:,2),'--',BSper(:,1),BSper(:,2),'-.'); legend('Control polygon','Quadratic','Cubic','Quadratic periodic')set(h, 'LineWidth',2)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%[1] http://m2matlabdb.ma.tum.de/download.jsp?MC_ID=7&SC_ID=7&MP_ID=485

This function is created to convert the classical orbital elements to cartesian position and velocity parameters of any satellite orbit in the geocentric - equatorial reference system.Comment:If you need an example code you can send me an e-mail.Cleared for any question.

This function magnifies a specified rectangular area [xlm, ylm]in the current figure,and plots the magnified area on the same figure at axis defined by position posInputs: xlm = 1x2 vector specifying limits of x-axis ylm = 1x2 vector specifying limits of y-axis pos = 4x1 vector specifying position of new axis lwid = linewidth of lines in magnified plot showAxisLabels = boolean to turn axis labels on/offExample usage: x = 0:10; y1 = x; y2 = 3 - 0.5*x; figure; plot(0:10,y1,'k--','linewidth',2); hold on; plot(0:10,y2,'ko-','linewidth',2); hold on; axis square; xlm = [1.5,2.5]; ylm = [1.5,2.5]; pos = [.25 .6 .25 .25]; % pos = [x0, y0, xwidth, ywidth] magnifyPlot(xlm,ylm,pos,2,false) % call function(c) Rishabh Datta, 2021-02-12

Useful for setting up equations to solve for valid values of K.%%example use:syms s K;G=(4500*K)/(s*(s+261.2));RouthHurwitzSym(G)

Calculates a variety of air thermodynamic properties from the measured temperature, pressure, and humidity. Variables able to calculated: rho - [kg m^-3] - Densitymu - [N s m^-2] - Dynamic viscosityk - [W m^-1 K^-1] - Thermal conductivityc_p - [J kg^-1 K^-1] - Specific heat capacity (constant pressure)c_v - [J kg^-1 K^-1] - Specific heat capacity (constant volume)gamma - [1] - Ratio of specific heatsc - [m s^-1] - Speed of sound: c = (gamma*R*T/M)^0.5nu - [m^2 s^-1] - Kinematic viscosity: nu = mu/rhoalpha - [m^2 s^-1] - Thermal diffusivity: alpha = k/(rho*c_p)Pr - [1] - Prandtl number: Pr = mu*c_p/kM - [kg mol^-1] - Molar mass of humid airR - [J kg^-1 K^-1] - Specific gas constanth - [%] - Relative humidity (if dew point inputted)Calculations are based around atmospheric temperatures and pressures, i.e. not for the use of high temperature combustion. See references for details and limitations. References:Picard, A, Davis, RS, Glaser, M, Fujii, K, 2008, 'Revised formula for the density of moist air (CIPM-2007)', Metrologia, vol. 45, no. 2, pp. 149-155. DOI: http://dx.doi.org/10.1088/0026-1394/45/2/004Tsilingiris, P, 2008, 'Thermophysical and transport properties of humid air at temperature range between 0 and 100°C', Energy Conversion and Management, vol. 49, no. 5, pp.1098-1110. DOI: https://doi.org/10.1016/j.enconman.2007.09.015

% Transistor Switching Loss demonstrates switching power loss due to% the turn-on delay time, rise time, on time, turn-off delay time and fall time.% User can enter the parameters based on datasheet to see how these% parameters affected the power loss.%% Switching frequency is set at 1kHz with duty cycle of 0.1%, which is% based on MOSFET IRF540N datasheet test condition%% Note: Switching power loss calculation does not that turn-on delay time% and off time into account.%% Written by Rodney Tan (PhD)% Version 1.00 (Jan 2021)

Generate the code for an CSS/HTML-based data table from an input numeric, string, or cell array.The generated HTML code is compatible with any browser and app designer ('HTMLSource' for an HTML element). With 60 user adjustable parameters, and multiple accepted input formats, the table can be customized in virtually any way.All parameters are invoked via name-value pairs and validated.Please read the description at the beginning of the function for details of the arguments and examples.This function does not support nested tables, i.e., cells within cells, as many parameters need to be matched to the width or height of the table.

Example using matrix X = [1 2; 2 5; 3 6; 4 10; 7 11; 10 13];p = [0.25 0.50 0.75];Q = quantile(X,p)Q = 2.2500 5.25003.5000 8.00006.2500 10.7500See more examples described in the script files.

Makes JSON strings (relatively) prettyMostly meant for structures with simple strings and arrays; gets confused and !!mangles!! JSON when strings contain [ ] { or }.

This is a combination method between Newton-Raphson and Backward Euler. This method can be used if the function is hard to derivate using analytical method.

This MATLAB functions evaluates the Mittag-Leffler (ML) function with two parameters ALPHA and BETA at the square matrix argument AE = ML(A,ALPHA,BETA) evaluates the ML function with two parameters ALPHA and BETA at the square matrix A argument; ALPHA must be any real and positive scalar, BETA any real scalar and A any real or complex square matrix. E = ML(A,ALPHA) evaluates the ML function with one parameter ALPHA at the square matrix A argument; ALPHA must be any real and positive scalar and A any real or complex square matrix.REFERENCES[1] R. Garrappa and M. Popolizio, Computing the matrix Mittag–Leffler function with applications to fractional calculus, Journal of Scientific Computing, 2018, 17(1), 129-153 - doi: https://doi.org/10.1007/s10915-018-0699-5[2] R. Garrappa, Numerical Evaluation of two and three parameter Mittag-Leffler functions, SIAM Journal of Numerical Analysis, 2015, 53(3), 1350-1369.

Any number of images can resize, convert the file type and save using only one command.Advantages:- Supports multiple image files simultaneously- Convert to any image type- Resize images- Specify the folder name- Specify the file name- See the progress dialogue box- List of Image type conversion supports: "jpg" , "png" , "tff" , "tfff" , "bmp" , "jpeg" , "gif" , "eps" , "raw" , "cr2" , "nef" , "orf" , "sr2".- Automatically open the saved image folder after finishingExample:imageResize(options)options: 4 options available1. folderName=save images in "dir\folderName"2. fileName= Specify File Name. Like-- "Image"3. imSize= Specify the image size. Like-- [Heigth Width]4. fileType= Specify file type. Like-- "jpg"Save images in "dir\folderName\Image1.jpg

There are many solutions for automatically downloading files from GitHub. However, they work easily mainly under Linux, needing the libraries wget or curl. If someone works with Windows or directly wants to use MATLAB, this program is useful.The syntax isfilestr = githubFetch(user, repository, downloadType, name)with the inputsuser: name of the user or the organizationrepository: name of the repositorydownloadType: 'branch' or 'release'name: if downloadType is 'branch': branch name (default: 'master') if downloadType is 'release': release version (default: 'latest')and the outputfilestr: path to the downloaded file (empty if the downloading failed)Examples: 1) githubFetch('GLVis', 'glvis', 'branch') % same as githubFetch('GLVis', 'glvis', 'branch', 'master') 2) githubFetch('matlab2tikz', 'matlab2tikz', 'branch', 'develop') 3) githubFetch('matlab2tikz', 'matlab2tikz', 'release', '1.1.0') 4) githubFetch('matlab2tikz', 'matlab2tikz', 'release') % same as githubFetch('matlab2tikz', 'matlab2tikz', 'release', 'latest')

MYGINPUT Graphical input from mouse with custum cursor pointer.[X,Y] = MYGINPUT(N) gets N points from the current axes and returns the X- and Y-coordinates in length N vectors X and Y. [X,Y] = MYGINPUT(N, POINTER) also specifies the cursor pointer, e.g. 'crosshair', 'arrow', 'circle' etc. See "Specifying the Figure Pointer" in Matlab's documentation to see the list of available pointers. MYGINPUT is strictly equivalent to Matlab's original GINPUT, except that a second argument specifies the cursor pointer instead of the default 'fullcrosshair' pointer. Example:plot(1:2,1:2,'s');hold on[x,y] = myginput(1,'crosshair');plot(x,y,'o');hold off MYGINPUT is copied from Matlab's GINPUT rev. 5.32.4.4.

Copies all external code files necessary to run a script into a subfolder. Use cases are for example - execute on a remote server - give code away - for backup / archiveCareful: All necessary code must be on Matlab's path when invoking copy_dependencies; it doesn't warn if anything is currently missing. Therefore to be on the safe side, run the "start_mfile" firstly in order to see if everything works. Afterwards you can run copy_dependencies. Input arguments - start_mfile : Existing Matlab file that is supposed to run (required) - destination : Folder where to save the dependencies (default: new subfolder in current directory)

[COEFF,SCORE,LATENT,EXPLAINED] = fastpca(data) Fast Principal Component Analysis for very high dimensional data (e.g. voxel-level analysis of neuroimaging data), implemented according to C. Bishop's book "Pattern Recognition and Machine Learning", p. 570. For high-dimensional data, fastpca.m is substantially faster than MATLAB's in-build function pca.m.According to MATLAB's PCA terminology, fastpca.m needs an input-matrix with each of N rows representing an observation (e.g. subject) and each of p columns a dimension (e.g. voxel). fastpca.m returns principal component (PC) loadings COEFF, PC scores (SCORE), variances explained by the PCs cumulatively in absolute values (LATENT) and in percent (EXPLAINED). Additionally, fastpca returns the PC loading of the small covariance matrix (COEFFs).Decrease in computation time results from calculating PCs first from the (usually smaller NxN) covariance matrix of the transposed input-matrix "data" and then projecting them onto the observations, in order to obtain the PCs of the large DxD covariance matrix. By default, fastpca removes the mean of each observation. In this implementation of fastpca, I skipped calculation of Hotelling’s T-Squared Statistic.Example:In medical image analysis, there are often datasets with few to several hundreds of observations (subjects) and hundreds of thousands dimensions (voxels). As an example, I compare MATLABs PCA and fastpca.m using a random matrix with 300 rows and 500000 columns: data = rand(300,500000);tic; [COEFF,SCORE,LATENT,~,EXPLAINED] = pca(data); toc>> Elapsed time is 37.295108 seconds.tic; [COEFF,SCORE,LATENT,EXPLAINED] = fastpca(data); toc>> Elapsed time is 4.853614 seconds.Version 2.2 from 02/08/2021: fastpca is now implemented in Python and available on GitHub: https://github.com/dpblum/fastpca.gitVersion 1.21 from 12/07/2021. Version 1.0 from 08/08/2019. Implemented by Dominik Blum. E-Mail: dominikblum1987@gmail.com

Computes the bias-corrected and accelerated bootstrap estimate for confidence intervals and 2-tailed p-values of Efron, B., & Tibshirani, R. J. (1993). An Introduction to the Bootstrap, Chapman & Hall/CRC: New York.Usage:[p,CI] = BCa_bootstrap(data,loo,boot,null,confidence)[p,CI] = BCa_bootstrap(data,loo,boot,null,confidence,adjustment)p is the two-tailed p-value and CI is the confidence interval.data - the statistic of interest calculated on the dataloo - a vector of length N of the leave-one-out values of the statistic of interest.boot - the bootstrapped values of the statistic of interestnull - (optional) the value of the statistic of interest under the null hypothesis. Defaults to 0.confidence - (optional) the % confidence for upper and lower bounds of the confidence interval. Defaults to 95%adjustment - (optional) NOT RECOMMENDED. This is included for a specialized application. The integer value entered here will include that many observations equal to the null value into the bootstrap values AFTER calculating the bias and acceleration.Jared Van Snellenberg, PhD, 2009

For pedagogic / scientific diffusion purposes.F5 to run and create the animation file named 'GPS_constellation &_working_principle_model.gif' that will appear in the same directory as you registered this .m file.Dashed green lines links show visible spacecrafts (white dots) at a certain time on a certain place on the planet. Theoritically minimum satellites vsible in the sky to give position and time is 4 (three for position, one for time)Orbital angle values may be different from reality.Old piece of code, still suboptimal cause not maximum factorized.

Versatile function for representation of PCA scores. It can utilize data coming form PCA calculations and creates 2D PCA score with mean Euclidean Distance within and between groups. Prepared score plot can be automatically saved in current directory.

This function calculates the Risk Ratio and the Odds Ratio (OR) on a 2x2 input matrix. Both ratios are computed with confidence intervals. If confidence interval of OR doesn't encompass the value OR=1, then the function computes the Bayesian Credibility Assessment of the test. If the test is credible, the function calculates the Association Parameter Phi. The association parameter Phi=sqrt(chisquare/N). The routine coumputes the Power and, if necessary, the sample sizes needed to achieve a power=0.80 using a modified asymptotic normal method with continuity correction as described by Hardeo Sahai and Anwer Khurshid in Statistics in Medicine, 1996, Vol. 15, Issue 1: 1-21.

This code was created with GUIDE to create an interactive window which helps visualize light polarization. Circular, elliptical and linear polarization can be seen in the graph generated. You can input the phase of the two interacting light waves and the type of polarization will be displayed.

This function solves the following formula: Pn(x) = f(x0) + f[x0,x1](x-x0) + f[x0,x1,x2](x-x0)(x-x1) + ... + f[x0,x1,..,xn](x-x0)(x-x1)..(x-x[n-1]),where: f[x0,x1] = (f(x1-f(x0))/(x1-x0),f[x0,x1,..,xn] = (f[x1,..,xn]-f[x0,..,x_[n-1]])/(xn-x0), .... ,i.e. the divided differences.This function was inspired by the function by the Divided Differences function of T.R. Here, I simply added the capability of directly outputting the coefficients of the associated polynomial. So that the polynomial can be evaluated to produce interpolations/extrapolations directly with Matlab's 'polyval' function.Happy coding ; )

This M file creates GUI for measuring True RMS Voltage, Current, Fundamental Voltage and Current, THD, Individual Voltage and Current harmonics. Keep the voltage.xlsx file and current in test1.xlsx file in current path locationPress the Voltage rms, Current rms, Fund Voltage , Fundamental current and THD Block.In Hamonic Number Field, Enter Harmonic Number and to display corresponding harmonics is obtained by pressing Voltagehrms and currenthrms

Etopo website has removed the XYZ output format. In order to convert the GeoTIFF files into the conventional XYZ files for the numerical model, such as COMCOT tsunami model, I wrote a simple m code for converting GeoTIFF to XYZ.

% Buck converter critical inductance interactive tool assist user to % determine the critical inductor value for buck converter design. The% critical inductance determine the Boundary Conduction Mode (BCM) of a% buck converter.% The critical inductance versus switching frequency characteristic curve % is computes based on the desire buck converter output voltage and current.% User can adjust the duty cycle using the slider to see how the duty cycle % affects the critical inductance characteristic curve.%% Written by Rodney Tan (PhD)% Version 1.00 (Jan 2020)

This function displays a Flower (actually large size character) and a rotating marque message 'Happy Birthday' with changing colors. Colors are changed in a while loop. Message and flower can be changed via input arguments. Color change speed can also be modified by changing (t2-t1)/1e7>.25 to like (t2-t1)/1e7>.5 for slower change.Inspired by:https://www.mathworks.com/matlabcentral/discussions/highlights/134287-happy-st-patrick-s-day-simple-emoticon-animation-demo.

automated-nctools is a suite of automated MATLAB functions for netcdf files.For now there is only the following function: ncextract.m function that searches for the nearest k-neighbors to the control points, within regular lonlat grid or does exact comparison to the grid cells of the gridded data.Fuctions:isverbose_logfolder_extract_ncand a major ovehaul of ncextract ... are coming soon.

This function displays a progress bar, given the total number of iterations. The counter is updated every time the function is called.

1. Voltage and current excel file is downloaded from the below link https://www.mathworks.com/matlabcentral/fileexchange/87854-voltage-and-current-data-set2. keep the file in the same path of the .m file. 3. Run the .m file4. Enter harmonic number in the field of harm number 5. Press Power quality measurement6. Press Vhrms and Ihrms

The "current folder history" stores paths to directories that were once current (it differs from the search path). When paths from networks end up on the current folder history and the network becomes unavailable, an undefined variable or function (often caused by a typo) may cause an unbearable delay in the error message to appear [1,2,3]. To alleviate this problem, this function produces a GUI that lists all paths on the current folder history and you can select which paths to remove from the history. The GUI will create a backup of your original history in case you want to restore it.This was initially developed in Matlab r2017b and does not work with previous releases but the problem did not occur prior to then anyway. Latest release updated in r2021a. To participate in discussions on this topic, mention me (@Adam Danz) in link #2 below. [1] https://www.mathworks.com/matlabcentral/answers/395876-undefined-function-error-is-very-slow-to-occur[2] https://www.mathworks.com/matlabcentral/answers/364153-40-seconds-waiting-for-undefined-function-or-variable-error-2017b[3] https://www.mathworks.com/matlabcentral/answers/412972-matlab-218a-stalls-on-undefined-variables

Adds a text specified by str as 3D lines plot in the current axes. The text is places with its lower left corner at location specified by x,y,z (which corresponds to 'HorizontalAlignment', 'left', 'VerticalAlignment', 'baseline' of MATLAB's text function). Default glyph height is approx 1 unit, text size can be scaled using 'scale' parameter. Text default orientation is in xy-plane. The orinatation can be modified using 'rz','ry' and 'rx' parameters. Note: rotation order is rz > ry > rx.The True Type Font Simplex.ttf is implemented here. Note: only the most important glyphs are implemented. Instructions on how to add more glyphs included in description of function.

A function designed to simply plot a neural network architecture consisting of a couple of layers. Lines correspond to weights and nodes correspond to biases which are colored based on relative magnitude to the maximum and minimum weight or bias present in the plot. Provides integration with the Deep Learning Toolbox's network training interface, and adds a button to bring up the network plot which will update at each epoch. Example Use:network = fitnet(num_hidden_layers);network.plotFcns = [network.plotFcns 'plotShallowNetwork'];[t_network, t_Record] = train(network, in_data, out_data);

This piece of code contains the source code for canonical variate analysis. For more details please refer to the book chapter "Smart Monitoring of rotating machinery for industry 4.0 - Theory and application - A tutorial on Canonical Variate Analysis for diagnosis and prognosis".

In a nutshell: An updated Version of https://de.mathworks.com/matlabcentral/fileexchange/328-tilefigs-m for HG2 and multi-monitor-supportAutomatically detects the usable desktop space and figure borders for overlap-free arrangements.

vec2grid.m DocumentationThis is a simple utility to rearrange a list of data points into an ndgrid-style grid. It allows the original data points to be listed in any order, and allows for missing grid points (which become NaNs in the final grid).Note: In order to support higher dimensional data, I opted to return data in ndgrid format rather than meshgrid format. This means output will often need to be transposed to be used with plotting functions like surf, pcolor, etc.Syntax[xg, yg] = vec2grid(x1, x2, ..., y);[xg, yg] = vec2grid(xy);[xg1, xg2, ... yg] = vec2grid(...);ExampleLet's assume we have a list of 2D data points, with a corresponding vector of z-data for each x-y point. The data points are stored in random order, and a few points are missing from the full grid.[x,y] = ndgrid(1:4,1:5);z = (1:numel(x))';order = randperm(numel(x), numel(x)-3)';x = x(order); y = y(order); z = z(order);[x y z]ans = 1 3 9 3 5 19 4 3 12 3 3 11 2 2 6 2 4 14 4 5 20 1 5 17 2 3 10 2 5 18 4 2 8 3 2 7 3 4 15 2 1 2 1 1 1 1 4 13 3 1 3We use vec2grid to return the data to a gridded format.[xg,yg,zg] = vec2grid([x y z])xg = 1 2 3 4yg = 1 2 3 4 5zg = 1 NaN 9 13 17 2 6 10 14 18 3 7 11 15 19 NaN 8 12 NaN 20

IQML is a Matlab toolbox to retrieve financial market data and news from DTN IQFeed. Easy-to-use Matlab commands fetch market data from IQFeed, in either blocking (snapshot) or non-blocking (streaming) modes: * Live top-of-book market data (quotes and trades) * Live Level2 market-depth data * Historic, intra-day and live market data (individual ticks or interval bars) * Fundamental info on assets * Options and futures chains lookup (with market data, Greeks) * Symbols and market codes lookup * News headlines, story-counts and complete news stories, with user-specified filters * Connection stats and programmatic connect/disconnect * Ability to attach user-defined Matlab callback functions to IQFeed messages and market events * User-defined custom alerts on streaming market events (news/quotes/interval-bar/regional triggers) * Combine all of the above for a full-fledged end-to-end automated trading system using plain MatlabIQML was optimized for reliability, ease-of-use, functionality and performance (including parallelization). IQML only need the core Matlab to run, no additional toolboxes are required. Parallelization requires the Matlab Parallel Processing Toolbox, but IQML works well even without it.A detailed User Guide is included, complete with working usage examples and implementation tips.This downloadable version is fully-functional and can run 30 days for free.It does not require any additional products or toolboxes, except an active IQFeed data account and a locally-installed IQFeed client.Additional information and usage examples can be found on: - IQML's product page: http://IQML.net or https://undocumentedmatlab.com/IQML - IQML's GitHub repository: https://github.com/altmany/IQML (where you can report any program issues)For related questions and feedback, please contact me: altmany (at) gmail.com

MATLAB code to plot the Moody chart, showing the relationship between the friction factor and the Reynolds number, for different roughness coefficients in a pipe.

clabel_along allows the user to specify a curve along which to place contour labels. This gives the user a great deal of control for contour placement, but also providing a system that is easily automated.

This code solves elliptic problem for 2D laplace equation for heat conduction using Liebmann's method. The boundary condition specified should be fixed temperature value and the grids generated should be square.For more information: Numerical Methods for Engineers by Canale & Chapra, Chapter 29

This function plots a Bloch sphere, visualizes a series of qubit states, and returns the figure handle and the xyz coordinates. Two input choices are provided: (1) 2-by-N complex numbers, which is the typical way people utilize to represent a qubit; (2) 3-by-N real numbers, which is the cartesian xyz coordinates for visualizing in a 3D unit-one sphere. This function also provides choice to plot the states in a provided figure (2nd input variable). Note that the input variable "state" should be unit cell type and each cell should be either 2-by-N or 3-by-N vectors.

Press keyboard to add or remove singular values and display result.Clip of current version:https://youtu.be/DeKt8kk2qMs

We've all been there... you know you wrote some code somewhere which would help you finish your task but you can't quickly remember where. Perhaps you need to update a graph in your thesis that you prepared a year ago and you know the y-axis label, or you want to remember how you applied a particular function in your code a while back. The codesearch function is a simple way to quickly search all your m-files for a particular search term. The function lists the matching m-files in the Command Window along with hyperlinks for:(i) opening the m-file in the MATLAB Editor and (ii) changing the Current Folder to the directory of the matching m-file.Additional functionality is described in the help text for the codesearch.

This code was made based on the paper by Dr. Vladimir Mandelshtam: 'Harmonic inversion of time signals and its applications', Journal of Chemical Physics 107, 6756 (1997). Copyright (C) 2015 - Alexandre Damião This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see This code will, from a given 1D signal, decompose it into: ---- \ s(t) = ) D_n * exp(-i (2 pi * F_n * t + P_n)) * exp(G_n * t) / ---- where D_n is the n-th amplitude content, F_n is the n-th frequency content, P_n is the n-the phase content and G_n is the n-th growth rate content.

DescriptionMATLAB's genpath(folderName) creates a character vector containg the path to folderName and any of its subfolders. genpath excludes folders starting with @, +, private, and resource, but it does not allow users to specify other patterns to exclude from its output.This can cause problems when users addpath using the output of genpath. For one, it becomes more difficult to parse the output of path because many potentially unused folders are now on the file path. And similarly, it can lead to frequent folder handle notifications from MATLAB as it searches through unusued folders for files--especially when using busy network drives.This is where genpath2 comes in. Inspired by Jesse Hopkins's genpath_exclude, genpath2 is a wrapper for genpath (instead of a standalone function) that executes genpath and then removes folders from its output matching a specified pattern.Usagegenpath2(folderName) returns a vector identical to genpath(folderName)genpath2(folderName, '.git') returns a vector without folders starting with .gitgenpath2(folderName, {'.git', '.svn'}) returns a vector without folders starting with .git or .svnContributingOriginal Author: Santiago I. Sordo-PalaciosIf you find a bug or would like to add a feature, please open and issue and submit a pull request via the GitHub Project. I do not monitor comments on the MATLAB File Exchange.

The publication of this function was inspired by the poor job done by several implementations of the 1d cubic spline publications in Matlab's file exchange repos.This function was part of one of my homework assignments when I was a master student in NTU back in 2011.Although it is not a perfect implementation, it is simple to read (the formulation is close the math equations), it can be parallelized (if parfor is available), the boundary conditions can be easily expanded/extended, and it is written in a single script with less than 125 lines of code (including a short intro and example). Enjoy ! : )

This file extends the Agent-Based Modeling Language NetLogo to interface with Matlab. Includes data-passing to and from Matlab, and execution of any valid Matlab commands from within NetLogo. Documentation and up-to-date downloads can be found at:https://github.com/mbi2gs/netlogo-matlab-extension/wiki