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.

Solve Ax = b where A is coefficient matrix, and b is right handside vector.

Particle Swarm Optimization algorithm is an evolutionary, Bio-inspired, Swarm-intelligence-based algorithm that simulates the collective behavior of a swarm of insects/animals, in searching for food. It was first developed by Eberhart and Kennedy in 1995, and since then, it has been modified and enhanced to fit a wide range of engineering and scientific problems, therefore there are many variants of PSO algorithm. However, Standard PSO algorithm is still the origin from which all variants have been developed.In this code I have implemented Standard PSO algorithm in a clear and simple script, and applied it on Eggcrate function, which is a widely known benchmark function used for validation of Global Optimization algorithms.The user can determine the inertia, Cognitive and Social coefficients, number of iterations, number of particles and initial velocity of particles, as well as determine the plot type as Surf or Contour.

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 converterDetails: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.

The function MVMD applies the Multivariate Variational Mode Decomposition (MVMD) algorithm [1] to multivariate or multichannel data sets. The method is an alternative to another popular algorithm named Multivariate Empirical Mode Decomposition (MEMD). We have verified this code through simulations involving synthetic and real world data sets containing 2-16 channels. However, there is no reason that it shouldn't work for data with more than 16 channels.% Input and Parameters:% ---------------------signal - input multivariate signal that needs to be decomposedalpha - the parameter that defines the bandwidth of extracted modes (low value of alpha yields higher bandwidth)tau - time-step of the dual ascent ( pick 0 for noise-slack )K - the number of modes to be recoveredDC - true if the first mode is put and kept at DC (0-freq)init - 0 = all omegas start at 0 1 = all omegas start uniformly distributed 2 = all omegas initialized randomlytol - tolerance value for convergence of ADMM% Output:% --------------------- u - the collection of decomposed modes u_hat - spectra of the modes omega - estimated mode center-frequencies[1] N. Rehman, H. Aftab, Multivariate Variational Mode Decomposition, arXiv:1907.04509, 2019.

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));

Downloads data tables from the NIST Chemistry Webbook (http://webbook.nist.gov/chemistry/fluid/) for a specified temperature and/or pressure range. The tables are useful for plotting or for data lookup by interpolation.

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 mixed signal. It can be used together with Hilbert transform (or other demodulation techniques) for time-frequency analysis.

ARROW3(P1,P2) draws lines from P1 to P2 with directional arrowheads. P1 and P2 are either nx2 or nx3 matrices. Each row of P1 is an initial point, and each row of P2 is a terminal point.ARROW3(P1,P2,S,W,H,IP,ALPHA,BETA) can be used to specify properties of the line, initial point marker, and arrowhead. Type "help arrow3" at the command prompt for more informationWhat's new in Version 5:All arrowhead and initial point marker sizes (W, H, and IP) are relative to the PlotBox diagonal.Version 5 attempts to preserve the appearance of existing axes. In particular, ARROW3 will not change XYZLim, View, or CameraViewAngle. ARROW3 does not, however, support stretch-to-fill scaling. If a particular aspect ratio or variable limit is required, use DASPECT, PBASPECT, AXIS, or XYZLIM commands before calling ARROW3. Users are encouraged to report problems directly to the author.

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

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.

The stress strain data can be imported from a csv file, or other method. Running the script will allow the user to click on the elastic region. The instructions are printed on the command line. The user should then click on two points in the elastic region. The program will then determine the elastic modulus, yield stress and yield strain. The parameters and curves will then be saved in the specified path.

This function will convert kml and kmz files to a matlab structure. If converting a kmz file it will extract it to a directory called '.kml2struct' in your home directory. This directory will be deleted when the function exits.The output of this function should be similar to 'shaperead' except that it will add another field, "Folder", for the kml folder where the shape was file.This function will only handle kml/kmz files with Point, LineString, and Polygon geometries. If you try to run this on a kml/kmz with different elements those elements will be omitted from the result

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

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.

Use the outputs from any of the contour plot functions to produce a table of (x,y) coordinates of the contour lines organized by contour level and group. [cm, h] = contour(___);contourTable = getContourLineCoordinates(cm);--or-- contourTable = getContourLineCoordinates(h);contourTable = Level.........Group..........X............Y ____________________________________ -5.8504.........1..........0.44266....-1.75 -5.8504.........1..........0.375........-1.8038 -5.8504.........1..........0.25..........-1.8526 -5.8504.........1..........0.125........-1.8498 etc....Where Level is the contour level in the LevelList of a contour object, Group is a grouping variable for contour levels, and (X,Y) are coordinates along the contour lines.

Analytic Hierarchy Process (AHP) is a simple technique, developed by Thomas L. Saaty in the 1970s, for organizing and analyzing complex multi-objective decisions. It combines both quantitative and qualitative analysis elements and it has particular application in group decision making. The philosophy of the technique is to decompose problem into a hierarchy of more easily understood sub-problems, each of which can be analyzed independently. Once the hierarchy is built, the decision makers systematically evaluate its various elements by comparing them to one another two at a time, with respect to their impact on an element above them in the hierarchy. The AHP converts these evaluations to numerical values that can be processed and compared over the entire range of the problem. A numerical weight is derived for each element of the hierarchy, allowing diverse and often incommensurable elements to be compared to one another in a rational and consistent way. In the final step of the process, numerical weights are calculated for each of the decision alternatives. These weights represent the alternatives' relative ability to achieve the goal.The function facilitates the following:•Simple AHP implementation•Multiple decision makers option•Simulation: An Monte-Carlo simulation-base extension of the Fuzzy AHP. The later is a special version of the simple AHP, which finds application in fuzzy environments, where the relative importance of the decision criteria and the alternatives is uncertain.•Analytic Network Process: The generalization of the AHP, which incorporates dependences and feedbacks between decision criteria and options.•Optimization: In case of a resource allocation problem, the function estimates the optimal feasible combination of alternatives subject to the resources constraints.•Prediction combination: In case this is a forecasting combination problem, the function generates a weighted averaged forecast, using the combination weights and the individual forecasts as inputs.•Combination of all the above

We know from analog modulation how DSBSC is superior to ordinary AM. In this code, you can find how DSBSC can be generated using MATLAB.

MATLAB function for plotting maps from OpenStreetMap and OpenSeaMap on the background of a figure.Example:Plotting several points on a map in Gothenburg archipelago and adding base map from OpenStreetMap (water and land) and overlaying with sea markings from OpenSeaMap.x = [11.6639 11.7078 11.7754 11.8063 11.8797];y = [57.6078 57.6473 57.6607 57.6804 57.6886];figure; plot(x, y, 'o-', 'LineWidth', 2);hBase = plot_openstreetmap('Alpha', 0.4, 'Scale', 2); % Basemap.hSea = plot_openstreetmap('Alpha', 0.5, 'Scale', 2, 'BaseUrl', "http://tiles.openseamap.org/seamark"); % Sea marks.

This is a GUI application that allows multiple files or directories to be selected and allows you to manage the list (remove files, reorder, etc.) before returning. It has basic filtering as well as regular expression filtering and navigation of the file system is easy. The output is configurable (cell, struct or char arrays). It is written entirely in M and so is platform independent.

This submission is a very simple code routine that I have used for many years for finding a maximal subset of linearly independent columns of a matrix. It is based on an old conversation with Bruno Luong, which has recently resumed here,https://www.mathworks.com/matlabcentral/answers/574543-algorithm-to-extract-linearly-dependent-columns-in-a-matrix#answer_474601and where he gives some mathematical explanation behind the method. I post this here for ease of reference, as it seems to be a frequently sought tool by Matlab Community members.USAGE:Extract a linearly independent set of columns of a given matrix X [Xsub,idx]=licols(X)in: X: The given input matrix tol: A rank estimation tolerance. Default=1e-10out: Xsub: The extracted columns of X idx: The indices (into X) of the extracted columnsEXAMPLE:>> A=eye(3); A(:,3)=A(:,2)A = 1 0 0 0 1 1 0 0 0>> [X,idx]=licols(A)X = 1 0 0 1 0 0idx = 1 2

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 function replicates the syntax for the built-in function 'find', but extends it to more dimensions.It is compatible with all releases up to and including MATLAB 6.5. For that release, the built-in find function doesn't support the find(X,K) syntax or find(X,K,side), while this function does.I have no access to even older releases, so I can't test compatibility, although I suspect this will work a few releases before 6.5.Licence: CC by-nc-sa 4.0

I'm sure by now you've all seen the Washington Post article with the COVID-19 simulation, speaking to the public health benefits of social isolation in the face of a highly infectious disease. If you haven't, here's the article: https://www.washingtonpost.com/graphics/2020/world/corona-simulator/Well, out of my quarantine boredom, I recreated this simulation in MATLAB, with more knobs to turn and parameters to play around with. For example, what if some of the carriers can die? What if the disease is Ebola instead (~50% mortality rate)?This function simulates disease transmission among a set of n carriers, in a confined space, with some proportion of carriers socially isolating themselves. A simple multibody physics model (elastic collision between two equal-mass particles) determines carrier trajectory.Hopefully this gives you a fun (albeit brief) respite from the doldrums of social isolation!

gif2avi(file) converts a gif file to an avi video and saves it to the current directory. gif2avi(file, destination) specifies where the avi file should be saved and its file name. gif2avi(file, '.mp4') converts to mp4 file.gif2avi(file, [ ], 'nLoops', n) records the gif loop n-times.Set the profile (output file type), FrameRate, Colormap, and Quality in VideoWriter by using name-value parameter inputs.aviFile = gif2avi(__) returns the full path to the avi file. [~, vidObj] = gif2avi(__) returns the VideoWriter object.When complete, a message is printed to the command window indicating the location of the output file. Special thanks to Walter Roberson for feedback that improved this submission.

% 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

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.

* * * 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.

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

Modification Extreme Learning Machine code from MR QIN-YU ZHU AND DR GUANG-BIN HUANG by adding calculation of sensitivity and specificity

A simple radar simulation which computes the roundtrip time of radar pulse based on the radar distance traveled.

num2strexact is a self-building C-mex function that converts a double or single input to the exact decimal string. The conversion is done with hundreds of digits of precision to maintain the exact conversion. The conversion uses the exact decimal value of each bit of the IEEE double precision floating point format along with the exact application of 2^exponent. Inf and NaN bit patterns are recognized, and denormalized numbers are handled also.Don't confuse the exact conversion with significance! Double numbers will only be significant to about 15 decimal digits, and single numbers will only be significant to about 7 decimal digits. For example,>> format hex>> 1.2ans = 3ff3333333333333>> num2strexact(1.2)ans = 1.1999999999999999555910790149937383830547332763671875>> 1.2 + eps(1.2)ans = 3ff3333333333334 <-- one bit different from 1.2num2strexact(1.2 + eps(1.2))ans = 1.20000000000000017763568394002504646778106689453125>> num2strexact(eps(1.2))ans = 2.220446049250313080847263336181640625e-16You can see that 1.2 is not represented exactly in IEEE double format. The difference shows up in the 18th digit for this example. Then note that the very next number in the IEEE double format model is about 2e-16 bigger. The exact conversions are shown for each number, but they are not significant beyond the 16th digit shown. There are no numbers in between these two numbers that can be represented in IEEE double format.Syntax: Y = num2strexact(X [,'fixed' or 'float']) [Y1 Y2] = num2strexact(X1,X2 [,'fixed' or 'float']) [Y1 Y2 Y3] = num2strexact(X1,X2,X3 [,'fixed' or 'float']) : : etc etcX = double or single or halfNOTE: The half type can be input in one of two ways: 1) A uint16 class variable containing the half bit patterns 2) A half class variable. num2strexact must have access to the underlying bit patterns, so if you input a half class variable, then this will first be converted to the equivalent integer bit patterns with the storedInteger function (a temporary deep copy).The number of inputs must match the number of outputs, except in thespecial case of 1 input and 0 outputs where the result will simply beput into ans. If the input is a scalar, the output will be a char string.If the input is any other size array, the result will be a cell array ofthe same dimensions as the input, with each cell containing the charstring conversion of the corresponding element.The optional 'fixed' argument forces the result to be fixed point.The optional 'float' argument forces the result to be floating point. Allnumbers will be printed with exponents, even if the exponent is 0.The default will be fixed or floating point depending on the size of thedecimal exponent. Numbers with -1 <= (decimal exponent) <= 2 will bedisplayed as fixed point, else the number will be displayed as floatingpoint.All NaN bit patterns, regardless of the sign bit and payload, will bereturned simply as the string 'NaN'.Infinity bit patterns will be returned as 'Inf' or '-Inf' as appropriate.num2strexact gives similar results to the following NUM2IEEE function by Steven Lord:http://www.mathworks.com/matlabcentral/fileexchange/2996except that num2strexact does not require the Symbolic Math Toolbox to display the potentially hundreds of exact digits, and num2strexact runs much faster.

The main motivation for developing a new algorithm is its capacity to effectively and efficiently solve various optimization problems. A novel optimization method, the forensic-based investigation algorithm (FBI), is developed to determine global solutions for continuous nonlinear functions with low computational effort and high accuracy. FBI is inspired by the suspect investigation–location–pursuit process of police officers. Main features of FBI: (1) FBI is a parameter-free optimization algorithm. (2) FBI remarkably outperformed the well-known and newly developed algorithms. (3) FBI has short computational time and rapidly reaches the optimal solutions in solving problems. (4) FBI is effective in solving high-dimensional problems (D=1000). (5) FBI structure has two teams that well balance exploration and exploitation.Details can be found at: Chou J-S, Nguyen N-M, FBI inspired meta-optimization, Applied Soft Computing, 2020:106339, ISSN 1568-4946, https://doi.org/10.1016/j.asoc.2020.106339.Contact me at: d10505808@mail.ntust.edu.tw or nnmai264@gmail.com

Simulates a Simulink model a number of times and records the execution time data. The results are then plotted, along with the min, max, and mean times. The user can specify how many simulations to perform.

Function can also return fft results.optionnal input argument:- 'legend': 'signal name'- 'title': 'your title'- 'window': 'none', 'hann', 'hamming', 'flattop', 'blackman', 'blackmanharris'- 'subplot': 'fft', 'fft_signal', 'fft_angle', 'all', 'none'- 'MinNorm': if norm is lower than this value, angle is forced to 0.(angle makes no sense for small norm)- 'H1': replace frequency axis with harmonic number (divide frequency axis by H1)- 'fmin': display frequency fmin to fs/2 (if H1 != 1 then fmin = Harmonic min)- 'fmax': display frequency 0 to fmax (if H1 != 1 then fmax = Harmonic max)- 'Amax': display amplitude 0 to Amax- 'style': 'line', 'stem', 'bar', 'stairs', 'area', (fft norm only)- 'scale': 'linear', 'semilogx', 'semilogy', 'loglog' - 'linewidth': number (defaut is 0.5)

The following functions illustrates the on-axis calculated intensities of the complete Rayleigh–Sommerfeld model presented in: "Modeling and propagation of near-field diffraction patterns: A more complete approach" by Glen D. Gillen and Shekhar Guha; American Journal of Physics 72:9, 1195-1201. (https://doi.org/10.1119/1.1767102). This model presents a diffraction formula which has no limitations on the maximum size of either the aperture or observation region.In the first part in relation to Fig. 2, a detector is placed at position (0,0,z), where z is on the order of 1000a, or 1000 aperture radii, and observe the central intensity as we reduce z. The code below calculates the intensity as a function of position along the z-axis with x_1 & y _1 = 0 for incident plane waves with a wavelength of 10 µm and a round aperture with a radius (a) of 100 µm in the aperture plane. The amplitude of the electric field of the incident light is assumed to be unity.In parallel to Fig. 2.a, Fig. 4 is an image plot as a function of the distance from the aperture, z, and the radial distance from the z-axis, using the complete Rayleigh–Sommerfeld model and the same aperture and laser field as in Fig. 2.Version 2 - presents Fresnel-Kirchoff and Fresnel Near Field approximations as a comparison

In only a few lines of code you can customize and simulate a network of leaky integrate and fire neurons (LIF). This function facilitates quick testing of network architectures. The network can be simple, only specifying the weights of the connections between neurons, or complex with options ranging from offset currents, refractory periods, speed of synaptic transmission, noise, etc.Usage notes, extensive examples, and sources are given in the help.

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.

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.

Based on and inspired by Sebastian Endrikat https://www.mathworks.com/matlabcentral/fileexchange/52343-find-vortices-in-velocity-fieldsUnderlying math presented by L Graftieaux "Combining PIV, POD and vortex identification algorithms for the study of unsteady turbulent swirling flows" https://iopscience.iop.org/article/10.1088/0957-0233/12/9/307/pdfThanks a lot!Sebastian's code is rather slow, though, because it uses 4 nested for loops. Producing the gamma1 map can be done more efficiently in Matlab by realizing that the operations described in the Graftieaux's paper can be rearranged into two convolutions. This code does that, basically. It also find the maximum gamma 1 by fitting a spline curve, therefore not being limited by the grid resolution of the vector field.The drawback is that it'll find only one vortex core, which might not be desired in some applications where multiple vortices form. One can, however, use the second output (G1) to perform their own peak finding/thresholding to find multiple vortex cores.Write-up of the details on https://zigunov.com/2019/07/08/finding-vortex-cores-with-gamma-1/Hope it was useful!-FZ

% 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)

function K=Fast_Matrix_Assembly(Elements) Input:---------Elements: a structure contains Elements{i}.K and Elements{i}.DOFs (Stiffness and Degrees of freedoms of the ith element).output:---------K: Sparse global stiffness matrixReferences-----------------Cuvelier, François, Caroline Japhet, and Gilles Scarella. "An efficient way to perform the assembly of finite element matrices in Matlab and Octave." arXiv preprint arXiv:1305.3122 (2013).

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

If my edfread function fails on your file, try edfreadUntilDone.NOTE: Support for this function is being deprecated. Please see:https://blogs.mathworks.com/pick/2020/07/10/deprecating-support-for-edfread-and-edfreaduntildone/

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

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

% Np = the population of the community. (Default = 100, so you easily % read the percentage of the community infectious/infected)% Ni = the number of index case (initial infecious individual, Default = 1).% Ds = is the minimum safe distance below which the probability of being % infected is Prinf (Measure of how contagious the disease is: % Lower means more contagious. Default = 0.05).% Prinf = probability that you will be infected if you are closer than Ds % to an infectious iindividial (Measure of how precautious people % are: washing hands, not touching mucus membrane. Default = 0.2).% Tr = Time it takes for an individual to be removed from the population % (Death, Quarantined, Recovered and become immuned. Default = 1).% F = Relative repulsive force strength (measure of social distancing Default = 1)% videoname = Simulation video file name

candlestick_plot(high,low,opening,closing,time,varargin)Draw a chart representing market's opening, high, low, and closing price of a specific time range.Candle body represents the price range between the open and close while sticks represents the price range between the high and lowtime can be datetime format

Calculates the Geothmetic Meandian as defined by xkcd.com/2435M = geothmetic_meandian(X)M = geothmetic_meandian(X, dim)M is given by computating 3 parameters: mean(X), geomean(abs(X)) andmedian(X), and iterating the computation until the 3 parameters converge.The parameters are considered converged if their range < 1e-10 * range(X). The final M is the mean of the converged parameters.input:X: input arraydim: dimension on which calculations are applied (default = first non-singleton dimension)

Reads the sheet names from Excel file for the given format :: .xls, .xlsm, .xlsx, .xltm, .xltx, .xltm%%********************************************************************************% Name : xl_xlsfinfo% Author : Pruthvi Raj G% Version : Version 1.0 - 2011b Compactible% Description : Finds all the sheets in the Excel file ( .xls, .xlsm, .xlsx, .xltm, .xltx, .xltm)% Input : File_Name with path included.% Date : 11-Feb-2020%% Examples : xl_xlsfinfo('D:\Pruthvi\Test_file.xls')%*********************************************************************************

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.

saves the values in the structure 'data' to a file in JSON format.Based on the work of Lior Kirsch at: https://uk.mathworks.com/matlabcentral/fileexchange/50965-structure-to-jsonModification by Arthur Y.C. Liu 24/06/2020Example: data.name = 'chair'; data.color = 'pink'; data.metrics.imageSize = [1920; 1080]; data.metrics.height = 0.3; data.metrics.width = 1.3; saveJSONfile(data, 'out.json');Output 'out.json':{"name" : "chair","color" : "pink","eye" : [1,0,0,0,1,0,0,0,1],"metrics" : {"imageSize" : [1920,1080],"height" : 0.3,"width" : 1.3}}

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.

%GINPUTUIAX Graphical input from mouse with custum cursor pointer.% [X,Y] = ginputuiax(huiax,N) gets N points from the uiaxes, huiax and returns % the X- and Y-coordinates in length N vectors X and Y. % GINPUTUIAX is similar to Matlab's original GINPUT, except% that it works with UIFIGURE & UIAXES% Example:% ax=uiaxes; plot(ax,rand(1,100))% [x,y] = ginputuiax(ax,2)%% Adapted from GINPUTC by Jiro Doke% Wanwara Thuptimdang% Date: 1July2020

publication date and adress;Erkan, U., Enginoğlu, S., Thanh, D.N.H., Memiş, S., 2020. Improved Adaptive Weighted Mean Filter for Salt-and-Pepper Noise Removal, Proc. of the 2nd International Conference on Electrical, Communication and Computer Engineering (ICECCE), pp. 1-5, 12-13 June, Istanbul, Turkey. doi : 10.1109/ICECCE49384.2020.9179351.Abstract:In this study, we propose an improved adaptive weighted mean filter (IAWMF) to remove salt-and-pepper noise. The most prominent advantage of IAWMF is its ability to take into account the weights of noise-free pixels in the adaptive window. Hence, the new grey value occurs closer to the original grey value of the centre pixel than the grey value computed by the adaptive weighted mean filter (AWMF). Moreover, the proposed method utilises the advantage of AWMF to reduce the error of detecting noisy pixels. In the experiments, we compare the denoising results of the proposed method with other state-of-the-art image denoising methods. The results confirm that IAWMF outperforms other methods.

This repo contains the Matlab code for Amplitude Modulation.

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.

Copyright 2019 by Dang N. H. Thanh. Email: thanh.dnh.cs@gmail.comVisit my site: https://sites.google.com/view/crx/sdmYou need to install the image processing toolbox ===================================================================Draw multiple boundaries of segmented results on the original image, where, inputimagepath - The path to input image, bordersize - The border width measured in pixel, segoption - This is 2D array, including the path of segmented images. The segoptions should be: segoptions = {{path0; color0}, {path1; color1}, ...};Note that: comma (,) and semicolon (;). For example:segoptions = {{'seg1.png'; 'r--'}, {'seg2.png'; 'b-.'}};PlotMultipleSegmentedBoundaries('orin.png', 3, segoptions);Note: result will be stored in the __boundaries folder of current path

If you ever found yourself in a situation where you could not or didn't want to add a directory to the MATLAB search path, but still needed speedy access to a function in that directory, this file is for you. In such cases, having to change directories to gain access to the function is not the best solution: you'd always have to take care to change the current path back to what it was (even on error). Moreover, performance in those cases can be poor if you have to call this function very often.FUNCTION_HANDLE allows you to create function handles which can successfully be evaluated without loss of performance, even if the function the handle points to is not on the MATLAB search path. While there often are better ways to accomplish this sort of task (package directories, symbolic links, etc.), there are a few niche cases where these solutions are simply more involved than using this FUNCTION_HANDLE constructor.Note that FUNCTION_HANDLE overloads a function present in standard MATLAB. This 'native' function is nothing more than documentation (linked to in the help for this constructor) and an error message which says that you cannot use the function to construct handles. As this is exactly what FUNCTION_HANDLE implements, this shadowing is desirable.Example session: >> F = function_handle('./path/to/function/myFcn.m') F = @myFcn >> A = function_handle(... {@cos, '../dir/not/on/path/myFunction.m'}) A = @cos @myFunction >> A{1}(pi) ans = -1 >> functions(A{1}) ans = function: 'min' type: 'simple' file: '' >> functions(A{2}) ans = function: 'myFunction' type: 'simple' file: '/fullpath/dir/not/on/path/myFunction.m'

AI Base Tic-Tac-Toe which uses MINIMAX algorithm to find next move.