This function will solve a best fit curve for the given data and equation by user using least squared method. Please input the equation number and if you want to see the best fit curve of the equation press '1'. You can input 'x' & 'y' column vector or from an excel file where 'x' & 'y' is in two columns. For this, don't put any input when calling the function, only call the function like: y=curve_fitting. Then input file name like: curve_data.

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.Known bugs:surf plot works on screen, but fails in the copy-paste procedure.To Do:write a version of the sub function adjust_color to adjust colormaps based on similar reasoning, (or replace colormaps?)Extend adjustColor to objects that has alpha (transprency) property. Done!

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.

Background•It is often required to investigate the effect of surface roughness with FE simulation- Example: friction, wear, fluid squeezing, thermal contact, vehicle on the rough road etc.•Abaqus / CAE does not support the random surface generationUsageDescription on the MATLAB function•MATLAB code input parameters (Lx,Ly,Lz,N,sn_x,sn_y,Wb_a,Wb_b) >> Abaqus inp file (orphan mesh)•Lx, Ly, Lz : length of periodic cell for x, y, and z-direction (Lz=0 generates 3D surface)•N: number of division for the distance between the sampling points•sn_x, sn_y: number of sampling points for x and y-direction•Wb_a, Wb_b: Weibull distribution parameters •Download the Rand_surf.m file and put it in the MATLAB directory (default is C:User\Document\MATLAB)•Enter [Nodes,Elements]=Rand_surf(Lx,Ly,Lz,N,sn_x,sn_y,Wb_a,Wb_b) in MATLAB command window•Roughness parameters and information on the Nodes and Elements are displayed after execution•Nodes and Elements lists for Abaqus input file is stored in MATLAB workspaceAbaqus input file is generated in MATLAB working directory Import in Abaqus / CAE•Open the inp file in Abaqus/CAE•File-import-Model-Choose Abaqus input File in File Filter Further informationDemo video (Youtube): https://youtu.be/DdnmJvsBCnYTutorial: refer to the pdf in the zip file+Note* You can also use Rough Surface Generator (RSGen) plugin for Abaqus/CAE * Contact: lyb0684@naver.comDemo video : https://youtu.be/kuCzG_OzWTM

This function implements a basic range-Doppler algorithm to focus raw SAR data. It has been successfully tested with L-band airborne SAR data, provided it has low squint.Inputs are the baseband raw data and 7 parameters that describe the SAR (sampling frequency, PRF, chirp parameters, etc.) A single-look-complex (SLC) focused image is returned as output.This code was written for educational purposes and for the sake of clarity, hence it can be improved for better focusing and computing performance.

VMD变分模态分解的Matlab代码2022/2/12 上传错了文件喵

First, upload a colour image by clicking on the “upload an image button”. The acceptable image formats are png, jpg, jpeg, img and tif. Then click on the "Plot the grayscale image". After that enter the no. of PC's up to which you want to retrieve the images (both colour and grayscale).An error message/box will pop-up when you enter a number greater than the no. of PCs for that particular image. Also, an error will message will pop-up when the entered input is not a number.Please go through this link for detail explanation;https://medium.com/@abhilash.singh/principal-component-analysis-pca-on-images-in-matlab-a-graphical-user-interface-gui-3d4999ddd0d0For a detail understanding of PCA, please refer my lecture on PCA;https://www.youtube.com/watch?v=ZLpQ6cbHxmYEnjoy!!!

[h, cmap] = colorbarpwn(caxis1, caxis2, 'options')COLORBARPWN creates positive-white-negative colormap and colorbar.White is asigned to zero, if while location is not specified.Customized colormap/colorbar options are available for: - automatic/manual positive, white, and negative color. - predefined colors for different combinations of colormap spectrum. - automatic/manual positive, negative, or positive-negative colormap. - automatic/manual white position (at zero or specified). - reversed default positive and negative colors. - reversed colorbar direction by switching the order of input limits. - number of colormap levels. - LaTeX colorbar label. - log scale colormap with adjustable loginess. - extended white region to display small values in a uniform color. - returning colorbar handle and/or colormap array.-------------------------------------------------------------------------Syntax:colorbarpwn(caxis1, caxis2)colorbarpwn(caxis1, caxis2, 'options')colorbarpwn(target, __)h = colorbarpwn(__)[h, cmap] = colorbarpwn(__)cmap = colorbarpwn(__, 'off')-------------------------------------------------------------------------Description:colorbarpwn(caxis1, caxis2): creates automatic colormap and colorbar based on caxis([cmin, cmax]), where cmin = min([caxis1, caxis2]) and cmax = max([caxis1, caxis2]). The colormap has a default style in which zero is in white, positive is in red, and negative is in blue. When caxis1 < caxis2, the colorbar is displayed in 'normal' direction; when caxis1 > caxis2, the colorbar is displayed in 'reversed' direction (see e.g.[3]).'options':(one input/output option can be used independently or with other options)colorbarpwn(__, 'rev'): creates reversed default colormap, where positive is in blue and negative is in red. 'rev' will be overwritten if 'colorP' or 'colorN' is manually specified. See e.g.[6]colorbarpwn(__, 'dft', 'colors'): change defaul colors in the order of positive, zero, negative with predefined colors. 'colors' is an 1 X 3 char variable which is a combination of any 3 characters from 'r' (red), 'b' (blue), 'g' (green), 'p' (purple), 'y' (yellow), 'w' (white), and 'k' (black). E.g., 'rgb', 'ywg', 'bwp', etc. 'dft' will be overwritten if 'colorP', 'colorN', or 'colorW' is manually specified. See e.g.[5].colorbarpwn(__, 'colorP', [R G B]): customizes positive color with RGB. See e.g.[1].colorbarpwn(__, 'colorN', [R G B]): customizes negative color with RGB. See e.g.[5].colorbarpwn(__, 'colorW', [R G B]): customizes white/zero color with RGB. See e.g.[5].colorbarpwn(__, 'full'): enforces full positive-negative color map with white is at the middle of [cmin, cmax]. See e.g.[5].colorbarpwn(__, 'full', Wvalue): enforces full positive-negative colormap and specifies white position by Wvalue. See e.g.[4].colorbarpwn(__, 'level', Nlevel): customizes the number of colormap levels (see e.g.[1, 5]). An odd integer is preferred. The default Nlevel is 127 if 'level' option is not used.colorbarpwn(__, 'label', 'LaTeXString'): creates a LaTeX colorbar label. See e.g.[3].colorbarpwn(__, 'log'): creates log scale colormap for coarser increment near white (smaller white region) with defualt loginess = 1. (citation [1]).colorbarpwn(__, 'log', loginess): creates log scale colormap and specifies the loginess value to make smaller white region (loginess > 0, see e.g.[3]) or larger white region (loginess < 0, see e.g.[6]).colorbarpwn(__, 'wrs', WhiteRegionSize): define the white color region size as a ratio to the total size of the colorbar/map, so small values are displayed in a uniform color. See e.g.[7]. 0 < WhiteRegionSize < 1.colorbarpwn(__, 'off'): set the colormap without creating a colorbar.colorbarpwn(target, __): sets the colormap for the figure, axes, or chart specified by target, instead of for the current figure and adds a colorbar to the axes or chart specified by target. Specify the target axes or chart as the first argument in any of the previous syntaxes. Similar to the combined use of colormap(target, map) and colorbar(target). See e.g.[3, 4].h = colorbarpwn(__): h returns a colorbar handle. See e.g.[4].[h, cmap] = colorbarpwn(__): h returns a colorbar handle and cmap returns the colormap array. See e.g.[5].cmap = colorbarpwn(__): cmap returns the colormap array only. See e.g.[6].-------------------------------------------------------------------------Examples:[1] colorbarpwn(-1, 2, 'level', 21, 'colorP', [0.6 0.4 0.3]): creates a colormap and a colorbar from -1 to 2 where 0 is in white color with 21 levels on one side and with customized positive color [0.6 0.4 0.3].[2] colorbarpwn(-1, 2, 'dft', 'ywg'): creates a colormap and a colorbar from -1 to 2 where the default positive color is changed to predefined yellow 'y', the default zero color remains white 'w', and the default negative color is changed to predefined green 'g'.[3] colorbarpwn(ax1, 2, 1, 'log', 1.2, 'label', '$\alpha$'): on axis ax1, creates a colormap and a colorbar from 1 to 2 with only positive color where the white color region is shortened by a loginess of 1.2; the colorbar is displayed in reversed direction as 2 > 1; the colorbar label desplays $\alpha$ with LaTeX interpreter.[4] h = colorbarpwn(ax2, 1, 3, 'full', 1.5): on axis ax2, creates a colormap and a colorbar from 1 to 3 with full default positive-negative color spectrum where white color is aligned with the specified Wvalue 1.5 following the 'full' option; h returns the colorbar handle.[5] [h, cmap] = colorbarpwn(-4, -2, 'full', 'colorW', [0.8 0.8 0.8], ... 'colorN', [0.2 0.4 0.3], 'level', 31): creates a colormap and a colorbar from -4 to -2 with full positive-negative color spectrum with 31 levels on each side where white color is customized with [0.8 0.8 0.8] and the negative end of the spectrum is in customized color [0.2 0.4 0.3]; the white color is aligned with the mean of caxis1 and caxis2 -3 on the colorbar as no Wvalue is specifice after 'full' option; h returns the colorbar handle and cmap returns the 31 X 3 colormap array generated.[6] cmap = colorbarpwn(-2, 2, 'log', -1, 'rev', 'off'): returns a 127 X 3 colormap array to cmap whlie disables displaying the colorbar; the colormap is with a reversed defualt color spectrum and the white color region is enlarged by a loginess of -1.[7] colorbarpwn(-1, 2, 'wrs', 0.4): creates a colormap and a colorbar from -1 to 2 with the default positive-negative color spectrum where the values between -0.4 and 0.8 are displayed in White; the red and blue linear color gradients tarts at 0.8 and -0.4 respectively, with a white regein in the middle.=========================================================================version 1.6.1 - Fixed a bug in v1.6.0 where the white color is not at zero when using default cmin and cmax settings.Xiaowei He09/01/2022-------------------------------------------------------------------------version 1.6.0 - Added an option 'wrs' for extending the White color region so small values are displayed in the White color and the color gradient does not start until a threshold. See description of colormap(__, 'wrs', WhiteRegionSize). - Adjusted the default red and blue color. - Fixed a bug where an even number level cannot be generated, although an odd Nlevel value is preferred for acurate Zero value positioning. - 'off' potion can now be used without an output argument.Xiaowei He08/25/2022-------------------------------------------------------------------------version 1.5.0 - Added several predefined low-saturation colors and an input argument 'dft' which allows for changing the default red-white-blue colormap with combinations of these predefined colors. See description of colormap(__, 'dft', 'colors') for details. - Fixed a bug that causes errors when the colorbar label string is the same as one of the input arguments.Xiaowei He05/28/2022-------------------------------------------------------------------------version 1.4.0 - Added support for reversed colorbar direction by switching cmin and cmax order, so the input limits became colorbarpwn(caxis1, caxis2). E.g., colorbarpwn(2, -1) displays a -1 to 2 colorbar in reversed direction, which is equivalent to cb.Direction = 'rev'. - Removal of the caxix1 < caxis2 rule accordingly. - Fixed a bug that causes an error when using 0 or 1 as the first caxis limit, i.e., colorbarpwn(0, caxis2) or colorbarpwn(1, caixs2). - Updates in headline description and examples.Xiaowei He05/23/2022-------------------------------------------------------------------------version 1.3.0 - Added support for setting colormap and displaying colorbar on specific target, e.g., colorbarpwn(ax, cmin, cmax). - Updates and corrections in headline description and examples.Xiaowei He05/07/2022-------------------------------------------------------------------------version 1.2.0 - Changed the function name from >>colorbarPWN to >>colorbarpwn for friendlier user experience. - Added an option 'off' which disables creatting the colorbar and only returns the colormap array. - Updates in headline description including a few examples.Xiaowei He04/27/2022-------------------------------------------------------------------------version 1.1.1 - Minor code improvement. - Updates in headline descriptions.Xiaowei He04/21/2022-------------------------------------------------------------------------version 1.1.0 - Added an output argument for the colormap array. - Added an input argument 'rev' for reversed default Positive and Negative colors, where Positive is in blue and Negative is in red. - Improved some logical structures. - Updated some descriptions in the headlines.Xiaowei He04/15/2022-------------------------------------------------------------------------version 1.0.1 - Fixed a bug when output coloarbar handle.Xiaowei He04/07/2022-------------------------------------------------------------------------version 1.0.0Xiaowei He03/30/2022=========================================================================citation [1]Connor Ott (2017). Non-linearly Spaced Vector Generatorhttps://www.mathworks.com/matlabcentral/fileexchange/64831-non-linearly-spaced-vector-generator,MATLAB Central File Exchange.function nonLinVec = nonLinspace(mn, mx, num) loginess = 1.5; % Increasing loginess will decreasing the spacing towards % the end of the vector and increase it towards the beginning. nonLinVec = (mx - mn)/loginess*log10((linspace(0, 10^(loginess) - 1, num)+ 1)) + mn;end=========================================================================

Inverse dynamics with recursive Newton-Euler of an open kinematic chain described with standard DH-parametersOptional:Robot toolbox is used for comparison: http://www.petercorke.com/RTB/Download and extract the files. Add the path to MATLAB using 'pathtool' command. Then type 'startup_rvc' in MATLAB command prompt.Limitations:- No gravity and external force/torque (coming soon ;-) )

AddLetters2Plots - adds labels A, B, ... to subplots in a figure.This function adds lables to the axes. You can change the letters, define the figure or a list of axes on which you want to add letters, change the position of the letters relative to subplots (as well as positioning the letters inside or outside the subplot), and change the font size. Syntax: AddLetters2Plots(fg_or_axes,Letters,Name, Value)Inputs: fg_or_axes - figure or a cell array of axes, by defeult is the current figure Letters - cell array of letters, by default {'A',...'Z'}) AddLetters2Plots(fg_or_axes,Letters,Name1, Value1,Name2, Value2, ...) specifies one or more of the following name/value pairs: 'FontSize' 'FontWeight' -- 'normal' | 'bold'(default) 'Color' [0 0 0] (default) 'HShift' and 'VShift' - horizontal and vertical shifts relative shift from -1 to 1 from the upper left cornner of the axis. default = 0 positive values for plotting inside the subplots, negative for plotting outside the subplots. if HShift, VShift are vectors, then different relative shifts are defined for each axis 'Location' location of the labels 'NorthWest'(default) 'NorthEast','SouthEast', 'NorthWest','SouthWest' 'FitLocation' false (default) 'FitLocation' = true provides a better atomatic placement of letters but is much slower because in this case drawnow function is used 'Direction' = 'LeftRight' or 'TopDown' label figures either from left to right or from top to downExample: Add letters A, B to the current figure AddLetters2PlotsAdd letters A, B to figure fg AddLetters2Plots(fg) Add letters (a), (b) and (c) to fg AddLetters2Plots(fg, {'(a)', '(b)', '(c)'})Add (a), (b) and (c) to axis1, axis2, axis3 AddLetters2Plots({ax1, ax2, ax3}, {'(a)', '(b)', '(c)'}) Add default letters outside of figures, order figure labeling from from top to bottom AddLetters2Plots(fg, 'HShift', -0.08, 'VShift', -0.02, 'Direction', 'TopDown')Code example fg = figure(1);clfsubplot(2, 2, 1)subplot(2, 2, 2)subplot(2, 1, 2)legendcolorbarAddLetters2Plots( 'HShift', [0, 0, 0], 'VShift', 0, 'Direction', 'LeftRight', 'FontSize', 10)Add latters to some axes onlyfg = figure(2);clfax1 = subplot(2, 2, 1);ax2 = subplot(2, 2, 2);ax3 = subplot(2, 1, 2);legendcolorbarAddLetters2Plots({ax1, ax3}, {'A', 'B'}) Add red letters in the bottom left corner. Note in this case the letters are outside of the axes. figure(3); ax1 = subplot(2, 2, 1); ax2 = subplot(2, 2, 2); ax3 = subplot(2, 1, 2); AddLetters2Plots('HShift', [0, 0, 0], 'VShift', 0, 'Color', 'red', ... 'Location', 'SouthEast')Add red letters in the bottom left corner and automatically move them into the axis boxes. SLOW!!! because of the drawnow function.figure(4);ax1 = subplot(2, 2, 1);ax2 = subplot(2, 2, 2);ax3 = subplot(2, 1, 2);AddLetters2Plots('HShift', [0, 0, 0], 'VShift', 0, 'Color', 'red', ... 'Location', 'SouthEast', 'FitLocation', true)

Run addDrawPolyToolbar/addDrawPolyToolbar(axes_handle) to add a polygon ROI drawing button to the current/given axes (alternatively, run addDrawPolyToolbar([],{'roi','test'}) to create a test figure)Press the button to interactively draw a polygon ROIPress spacebar/enter to enable or disable the ROI masking of line objectsMoving/resizing the ROI automatically updates the maskingPress shift+s to save the current mask structure and the vertices coordinates to the workspaceAdditional options included inside the function

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

SimpleEddyDetectionSimple Oceanic Mesoscale Eddy Detection based on sea level anomaly (sla)Inputs:lon: longitude, vector or matrix generated by "meshgrid" with range between [-180,180]lat: latitude, vector or matrix generated by "meshgrid" with range between [-90,90]sla: (spatial high-pass filtered) sea level anomaly (unit: meter) falls within the area defined by viarable "lon" and "lat". Continent or no value at grid point is masked with "NaN".upperFolderName: a string to signify the upper folder name or path.whichYear: The year of data "sla". Only an integer is accepted.whichMonth: The month of data "sla". Only an integer is accepted.whichDay: The day of data "sla". Only an integer is accepted. Can be replaced by "[]".whichHour: The hour of data "sla". Only an integer is accepted. Can be replaced by "[]".amplitudeThreshold (optional): unit: cm. Default is 3 cm. Note: this is an artificial threshold that an detected eddy is required to meet this criterion.radiusThreshold (optional): unit: Km. Default is 45 Km, designed for altimetry data due to its resolving capability. Note: this is an artificial threshold that an detected eddy is required to meet this criterion.Outputs:Eddy: a structure array contains the properties of detected eddies:Eddy.type: polarity of detected eddy. -1 for cyclonic while 1 for anticyclonic.Eddy.center: longitude and latitude of eddy centroid.Eddy.amplitude: longitude and latitude of eddy's sla extreme as well as eddy's amplitude (set to positive no matter if it is cyclonic or anticyclonic. Unit: cm)Eddy.radius: radius of an circle that has the same area as the eddy area enclosed by the eddy edge. Unit: KmEddy.edge: two vectors specify the longitudes and latitudes of eddy edge defined by the outermost closed sla contour.A NetCDF file will be generated if successful detection.Author:Dr. Chi Xu (SCSIO, CAS)SEP 07 2020http://data.scsio.ac.cn/characteristic/zhongchiduwoThis function is provided "as is" without warranty of any kind.

table2latex converts a table to the tabular form for use in LaTeX.Input argsT: a table of elementsselectedCols: index vector of table columns that need to beprinted. Default: All columns.label: the label for references to the table. Default: Empty.caption: the caption of the table. Default: Empty. colWidths: the widths for each column. Default: Equally adjustedwidth.isLandscape: flag to rotate table to landscape mode. Default:Vertical mode.notes: a cell array of additional notes after the table. Default: Notused. isAfterpage: flag to execute commands after pagebreak. Default: noafterpage.Output argsTtex: the formatted text for the tableDependenciesNoneLaTeX requirements for landscape view:\usepackage{afterpage}\usepackage{pdflscape} %rotates pageLaTeX requirements for table notes:\usepackage[flushleft]{threeparttable}UsageTtex = table2latex(T);Ttex = table2latex(T, [1:5]);Ttex = table2latex(T, [], 'tab:table1', 'Experimental Values', [], false, {'These are example values.'}, false);The function prints the formatted table, which thencan be copied and pasted to LaTeX as is.Created by foxelas [https://github.com/foxelas/] (2022)

This function provides a solution to the limited positions allowed by standard MATLAB Data Tips onmost 2-D plots by replacing them with a draggable version when the "Data Tip" mode is toggled off.Since standard data tips can only be moved to a position where one of its four corners touches theselected data point, this can unavoidably lead to obstructed portions of graphed data. Draggabledata tips can be moved anywhere within the current axes, thus allowing better visibility of theplot. New visual features are used to reference the draggable data tip to its corresponding datapoint and parent object. These include a connecting line between the data tip textbox and the datapoint as well as a border on the data tip that will try to utilize the same color and line weightproperties as the target parent object.The varargin input argument allows the user to optionally customize the data tips labels. Forexample, X- and Y-value labels can be replace with something more descriptive such as 'Time' and'Accel'. In addition to axis labels and when a plot legend is used, a header label can be added tothe data tip. Headers are added above the axis labels and match the target object's display nameas it appears in the legend. While the data tip header feature requires a legend to exist prior tocreation of the data tip, the legend can be deleted after creating the data tip and will noteffect the header label. If a legend does not exist when the data tip is created, the headeroption is ignored.Additional variable input options include setting the numerical precision and/or font size for thedisplayed data values, and adjusting the appearance of the leader lines by specifying the linestyle.While the labels/header options are applied to all axes within a single figure, it isstill possible to use different labels and headers throughout multiple axes or even on a singleaxes for a figure. This is done by applying DRAGDATATIP to a figure and adding a number of newdraggeble data tips, then reapplying DRAGDATATIP with a new set of options and creating additionaldata tips.NOTE: Draggable data tips can currently be removed by using one of the methods listed below: 1. Right-click on any single data tip and select delete single or all from the context menu. 2. Use the figure's "Edit Plot" tool, select the data tip, and press 'delete'. 3. Find and delete axes line objects with the "Tag" property set to 'DraggableDataTip'.DRAGDATATIP relies heavily on undocumented features and functions in MATLAB.

This code contains a function that selects the best answer in a Pareto front of any dimension through Techinique for Order Preference by Similarity to Ideal Solution. It is enough to deliver to the function the Space matrix of the objectives and the decision variables associated with it.

Read compressed or uncompressed NorPix image sequence in MATLAB.This script can read all frames or a set reading window.Index file will be used if available and named as the source file(eg. test.seq.idx). Otherwise the script will skip through a compressedsequence from the beginning (may take some time).INPUTS fileName: Char containing the full path to the sequence frames: 1x2 double array of beginning and end frameOUTPUTS ImageCellArray: Cell array with images and timestamps of all allocated frames. headerInfo: Struct with header information (ImageWidth, ImageHeight, ImageBitDepth, ImageBitDepthReal, ImageSizeBytes, ImageFormat, AllocatedFrames, Compression, HeaderVersion, HeaderSize, Description, TrueImageSize, FrameRate).EXAMPLES Read all frames: I = ReadJpegSEQ('C:\test.seq') Read frames 2 to 13: I = ReadJpegSEQ('C:\test.seq',[2 13]) Include sequence header information: [I, headerInfo] = ReadJpegSEQ('C:\test.seq',[1 1])Last modified 05.11.2021 by Paul Siefert, PhDGoethe-University Frankfurtsiefert@bio.uni-frankfurt.deBased on the work of Brett Shoelson (Norpix2MATLAB_MarksMod.m)Thanks to NorPix support for providing sequence information.This code was tested with Norpix SEQ8-bit monochrome 75% lossy jpeg compression (24.07.2018)8-bit monochrome uncompressed (03.06.2019)8-bit(24) BGR 75% lossy jpeg compressed (04.10.2021)Code for RGB included but not tested!Please report any bugs and improvement suggestions!

%SURF2STL Write STL file from surface data.% SURF2STL(surfhandle, 'filename') writes a stereolithography (STL) file% for a surface with the given handle surfhandle. It eliminate triangles% with zero area. %% SURF2STL(...,'mode') may be used to specify the output format.%% 'binary' - writes in STL binary format (default)% 'ascii' - writes in STL ASCII format%% Example:% [X, Y, Z] = peaks;% s = surf(X, Y, Z);% surf2stl(s, 'test.stl');% See also SURF.

Function to create a figure showing the individual data points, mean, standard deviation, and distribution of multiple categories. Plot the distribution to the right of the figure outline (default) or next to the error bars. Choose between a kernel (default) or gaussian distribution. If the distribution is plotted to the right of the figure outline, the figure contains two subplots: Fig.jit and Fig.dist. If the distribution is plotted next to the error bars, the figure contains one subplot: Fig.jit. Options such as personalized colors, marker size, linewidth, etc. are included. % Example code with random data data = [randn(1,50) randn(1,50)+1.6 randn(1,50)+1.4]; cats = [cellstr(repmat('Group A',50,1)); cellstr(repmat('Group B',50,1)); cellstr(repmat('Group C',50,1))]; figureFig = jitter_distribution_figure(data, cats, 'YLabel', 'Y label'); set(Fig.jit,'FontSize',23,'linewidth',2,'box','on')

Create three-dimensional boxplots in Matlab, data can be arranged in columns and levels in a single 3D Matrix or a single column and two grouping parameters. See description in GitHub for a tutorial.

Function to create a scatter plot showing the individual data points and the distributions on the X and Y-axis. Choose between a kernel (default) or gaussian distribution. The figure contains three subplots: Fig.scat, Fig.distx, and Fig.disty. Options such as personalized colors, marker size, trendline, etc. are included. % Example code with random data datax = [randn(1,50) randn(1,50)+3 1.5*(randn(1,50)+1.5)]; datay = [0.5*datax(1:50)+2+0.4*randn(1,50) 0.7*datax(51:100)+1.8+1*randn(1,50) 0.4*datax(101:150)+2.4+0.6*randn(1,50)]; cats = [cellstr(repmat('Group A',50,1)); cellstr(repmat('Group B',50,1)); cellstr(repmat('Group C',50,1))]; figureFig = scatter_distribution_figure(datax, datay, cats, 'YLabel', 'Y label','XLabel','X label'); set(Fig.scat,'FontSize',23,'linewidth',2,'box','on')

[h, cb] = plotcmap(X, Y, Z, cmap, LineValue, LineSpec, 'MatchMarkerFaceColor')PLOTCMAP plots a colormapped 2-D or 3-D line that maps the values ofanother variable onto the colormap on the line.Specifies LineStyle, Marker, and LineWidth in the same way as plot/plot3.-------------------------------------------------------------------------Syntax:plotcmap(X, Y, cmap, LineValue)plotcmap(Y, cmap)plotcmap(X, Y, Z, cmap)plotcmap(__, LineValue)plotcmap(__, LineSpec)plotcmap(__, 'MatchMarkerFaceColor')plotcmap(ax, __)h = plotcmap(__)[h, cb] = plotcmap(__)-------------------------------------------------------------------------Description:plotcmap(X, Y, cmap, LineValue): plots a 2-D line using plot(X, Y) and creates a colormap based on cmap on the line which maps the values of LineValue onto the colormap. X, Y, and LineValue must be mumeric vectors with same length. cmap can be one of the MATLAB predefined colormap names or an customized N X 3 colormap array. (list of predefined colormap names: parula, turbo, hsv, hot, cool, spring, summer, autumn, winter, gray, bone, copper, pink, jet, lines, colorcube, prism, flag, white)plotcmap(X, Y, cmap): plots a 2-D line using plot(X, Y) and creates a colormap based on cmap on the line without the values of LineValue where plotcmap maps an implicit set of values ranges from 1 to length(X).plotcmap(__, LineSpec): plots a colormapped line with specified LineStyle, Marker, and LineWidth. Use of LineSpec is the same as in plot or plot3. e.g., plotcmap(X, Y, cmap, LineValue, '--o') plotcmap(X, Y, cmap, 'LineWidth', 2). Note that plotcmap overwrites the line color property even if it is specified.plotcmap(__, 'MatchMarkerFaceColor'): matchs marker face colors of each marker to their corresponding LineValue to create filled markers.plotcmap(Y, cmap, __): plots a 2-D colormapped line using plot(Y).plotcmap(X, Y, Z, cmap, __): plots a 3-D colormapped line using plot3(X, Y, Z).plotcmap(ax, __): displays the plot in the target axes. Specify the axes as the first argument in any of the previous syntaxes. Same as plot or plot3.h = plotcmap(__): returns an array of Line objects.[h, cb] = plotcmap(__): h returns an array of Line objects. Displays the colorbar based on caxis([min(LineValue), max(LineValue)]), and cb returns the colorbar handle.-------------------------------------------------------------------------Examples:plotcmap(X, Y, parula, LineValue, '--', 'LineWidth', 2): plots a 2-D colormapped line that maps the values of vector LineValue onto the predefined colormap parula with dashed line style and linewidth of 2pt.plotcmap(X, Y, jet(20), 'o', 'MatchMarkerFaceColor'): plots a 2-D colormapped line that maps an implicit set of values ranges from 1 to length(X) onto 20 colors of the predefined colormap jet with filled circle marker.plotcmap(ax1, Y, cmap, LineValue): plots a 2-D colormapped line on axis ax1 based on an implicit set of x-coordinate values ranges from 1 to length(Y) that maps the values of vector LineValue onto the customized N X 3 colormap array cmap.h = plotcmap(X, Y, Z, cool, LineValue, ':s', 'MatchMarkerFaceColor'): plots a 3-D colormapped line that maps the values of vector LineValue onto the predefined colormap cool with dotted line style and filled suqare marker, and returns the line object array to h.[h, cb] = plotcmap(X, Y, summer, LineValue): plots a 2-D colormapped line that maps the values of vector LineValue onto the predefined colormap summer, returns the line object array to h, displays the colorbar, and returns the colorbar handle to cb.[~, ~] = plotcmap(X, Y, summer, LineValue): plots a 2-D colormapped line that maps the values of vector LineValue onto the predefined colormap summer and displays the colorbar.=========================================================================version 1.2.0 - Added an output argument that displays the colorbar and returns the colorbar handle. E.g., [~, cb] = plotcmap(__).Xiaowei he05/22/2022-------------------------------------------------------------------------version 1.1.1 - Fixed a bug that causes errors when plotting on target axes. - Minor updates in headline description.Xiaowei He05/07/2022-------------------------------------------------------------------------version 1.1.0 - Added support for using MATLAB predefined colormaps. - Updates in the headline description including a few examples.Xiaowei He05/01/2022-------------------------------------------------------------------------version 1.0.0Xiaowei He04/24/2022=========================================================================

Calling X = maximin(N, P, varargin) Generates N-uniformly distributed points in P dimensions using the following optional parameter-value pairs: - 'iterations' Specifies the number of iterations, per cycle. - 'cycles' Specifies the number of algorithm repetitions. - 'criterion' Specifies 'cartesian' or 'spherical' sampling. - 'data' Specifies existing data points in [M, P] form. - 'initial' Specifies a set of [N, P] points to reiterate.Examples of the use of this function are the following:% Generate 40 cartesian equally-spaced points in 3Dx = maximin(40, 3);plot3(x(:, 1), x(:, 2), x(:, 3), 'o')view(3)% Generate 20 equally-spaced points in 2D with pre-existing datay = rand(10, 2);x = maximin(20, 2, 'data', y);figurehold onplot(x(:, 1), x(:, 2), 'x')plot(y(:, 1), y(:, 2), 'o')% Generate 12 spherical optimally-sampled points in 3D (icosahedron) and create edgesp = maximin(12, 3, 'criterion', 'spherical', 'cycles', 20);figurehold onplot3(p(:, 1), p(:, 2), p(:, 3), 'o', 'Color', 'k')for i = 1 : 12 d = sum((p(i, :) - p) .^ 2, 2); d(d == 0) = Inf; [~, j] = mink(d, 5); for k = 1 : size(j, 1) x = [p(i, 1), p(j(k), 1)]; y = [p(i, 2), p(j(k), 2)]; z = [p(i, 3), p(j(k), 3)]; plot3(x, y, z, 'Color', 'k') endendpbaspect([1, 1, 1])view(3)% Circular packing problemp = maximin(10, 2, 'cycles', 20);d = zeros(10, 1);for i = 1 : 10 j = sum((p(i, :) - p) .^ 2, 2); d(i) = min(j(j > 0));endd = 0.5 * sqrt(min(d));a = 2 * pi * (0 : 1 / (1000 - 1) : 1)';c = d * [cos(a) sin(a)];figurehold onplot(p(:, 1), p(:, 2), 'x', 'Color', 'k')for i = 1 : 10 plot(c(:, 1) + p(i, 1), c(:, 2) + p(i, 2), 'Color', 'k')endxlim([min(p(:, 1) - d), max(p(:, 1) + d)])ylim([min(p(:, 2) - d), max(p(:, 2) + d)])pbaspect([1 1 1])

RotMatrix - N-dimensional Rotation matrixR = RotMatrix(alpha, u, v)INPUT: alpha: Angle of rotation in radians, counter-clockwise direction. u, v: If just the input alpha is provided, a 2D matrix is replied. For 1 input u, the 3D rotation matrix is created. u must have 3 elements. If u and v are used as inputs, the N-dimensional rotation is performed in the hyperplane spanned by u and v. Note, that there is no unique axis of rotation in N>3 dimensions. u and v are normalized automatically and in the N-D case v is made orthogonal to u. The dimension of u and v determine the dimension of the output.OUTPUT: R: Rotation matrix.REFERENCES:https://analyticphysics.com/Higher%20Dimensions/Rotations%20in%20Higher%20Dimensions.htmhttps://en.wikipedia.org/wiki/Rotation_matrixhttps://application.wiley-vch.de/books/sample/3527406204_c01.pdf

Over the years there were several questions posted here at MathWorks about how to compute a radial profile (like average spectral density). The same answer was repeated every time: go in a for loop over all radii and average the data which lays in a circle. When dealing with an image of just 1024x1024 it starts to be faster to deconvolve an image than to compute a radial profile!MatLab has a very fast own function accumarray which can do the trick with zero for loops. I have written a basic radial profiler which calls accumarray twice: first time to create radial ticks, and second time to create the average profile. In my application with 2048x1792 data I have ahieved 50x accelearation compared with the "for loop" approach. If you need to speed-up this function even more, consider using bwdist instead of meshgrid.This function can be further improved further in terms of accuracy of averaging by taking into account subpixel subtelties.

TeachLCGE serves two purposes.First, it is an example of creation of a stand-alone application withresponsive graphical user interface (ReGUI).Second, at the same time it is a helper application for supportingteaching extrema of functions of two real variables - local (in thisversion), constrained and global (both to be added later).-------------- ReGUI - Responsive Graphical User Interface --------------This application features the ReGUI -- Responsive Graphical UserInterface. When the application window is resized, the position and sizeof logical blocks might change in order to give optimal user experience.Read the article about the ReGUI here:https://arxiv.org/abs/1704.03521and take a look at the ReGUI demonstration video:https://www.youtube.com/watch?v=ndYC11vIT2Y----------- TeachLCGE - Local, Constrained and Global Extrema -----------VERSIONS:1.3 - Added support for new MATLAB R2021b version - str2sym(get())function implemented instead of get() function - Author: Martin Muzelák1.2- Constrained and global extrema are supported (both without ReGUI,which will be available later).1.1- In this version, only local extrema type is supported, other twooptions will be available later with upcoming updates.- Application is still in its early stage, some functions of two realvariables, that require different approach in terms of calculation,might not work.After launching the application, simple main menu is displayed, wherethe user can select the language and the type of problem to explore.After selecting the type of problem, the interface becomes the ReGUIinterface, and initially only "input field" is displayed. Input fieldconsists of input text field and three push buttons "Calculate","Show example" and "Clear the form". The whole process of using thisapplication then consists of the two simple steps:1st step: insert a function of two real variables into input text field;2nd step: press the "Calculate" button.When calculation is finished, the ReGUI is updated with the results.Results consist of:- coordinates of existing stationary points of the function;- function values of stationary points;- determinations, if each stationary point is a saddle point or extreme;- a 3D graph of the inserted function;- various graphs of partial derivatives of the function. In two of thesegraphs, stationary points are illustrated as the black dots and extremaas the red dots.For demonstration purposes a "Show example" button can be used, whichinserts a sample function into input text field and launches calculation.This button can be pressed repeatedly for more examples.TeachLCGE has been developed and successfully tested on MATLAB R2013aand R2015a.--------------------------------------------------------------------------------------------I am grateful to Prof. Igor Podlubny (http://www.tuke.sk/podlubny/) forteaching this approach in his course on computational tools for automationand informatization of processes, and to Dr. Jana Pocsova(jana.pocsova@tuke.sk) for her guidance, suggestions and support. Also,Dr. Andrea Mojzisova's advices and remarks are highly appreciated.Author: Matej Mikulszky, 2016-2017email: matej.mikulszky@student.tuke.skStudent, Technical University, Kosice, SlovakiaFor updates, please check the following link:http://bit.ly/mikulszky_mathworks

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.

This function solves Prandtl Meyer expansion using the relations given in "Modern Compressible Flow With Historical Prespective-John D. Anderson Jr" It is only accurate in the range for mach number M=[1,7] because I used an approximate relation in one of the cases You can solve for different cases depending on the given data for your problem, the values assigned for the flags determine the case you want to solve for. variables names ending with 3 refer to the stream before expansion. variables names ending with 4 refer to the stream after expansion. I used 3 and 4 for consistency with an oblique shock function I created before this.

This code helps user to add Gaussian and non-Gaussian noise to a signal, to generate a signal with preset SNR value.

% Reads a single binary file saved by Avantes AvaSoft8 software.% include '.RAW8', '.RWD8', '.ABS8','.TRM8','.RFL8','.IRR8','.RIR8'.function [Wavelength,Sample,Dark,Reference,Mode_data,h] = readRAW8(filename,specified_mode)% Reads a single binary file saved by Avantes AvaSoft8 software.% Yuanfei Jiang, 2022.02.05% jiangyuanfei@jlu.edu.cn% Institute of Atomic and Molecular Physics, Jilin University, P.R.China.% specify_mode: 0 - 6% 0 'Scope Mode'% 1 'Scope minus Dark Mode'% 2 'Absorbance Mode'% 3 'Transmittance Mode'% 4 'Reflectance Mode'% 5 'Absolute Irradiance Mode'% 6 'Relative Irradiance Mode'% for example:% [Wavelength,Sample,Dark,Reference,Mode_data,h] = readRAW8(filename)% If the mode parameter is not specified, it will read the mode from data file. % Returns the result calculated from the read mode.% % [Wavelength,Sample,Dark,Reference,Mode_data,h] = readRAW8(filename,specify_mode)% If the mode parameter is specified, it will ignore the mode read from% data file and use the specified mode parameter and returns the% calculation result of the specified mode.% % The number of pixels settings by factory can be read from data file.% If less number of pixels be used, the actual number of pixels will be % calculated.%

OBJDIFF compares two objects & returns an object of the same type with just the different fields/values. Unlike Matlab's SETDIFF or SETXOR, this OBJDIFF utility also compares structs, GUI handles, ActiveX, Matlab & Java objects, in addition to arrays & cells. OBJDIFF also allows comparison of numeric cell arrays, unlike SETDIFF/SETXOR. It also accepts anything that SETDIFF/SETXOR accept. Syntax: [objectC,IA,IB] = objdiff(objectA, objectB, options, ...) Inputs: - objectA - first object to compare - objectB - second object to compare. Field order in opaque objects does not matter. Note: If objectB is not supplied, then objectA(1) is compared to objectA(2) - options - optional flags as follows: 'rows' - see documentation for SETXOR 'dontIgnoreJava' - show different instances of the same java class (default=ignore them) Outputs: - objectC - object containing only the different (or new) fields, in a {old, new} pattern - IA,IB - index vector into objectA,objectB such that objectC = [objectA(IA),objectB(IB)] (see SETXOR) Examples: >> objectA = struct('a',3, 'b',5, 'd',9); >> objectB = struct('a','ert', 'c',struct('t',pi), 'd',9); >> objectC = objdiff(objectA, objectB) % a=different, b=new in objectA, c=new in objectB, d=same objectC = a: {[3] 'ert'} b: {[5] {}} c: {{} [1x1 struct]} >> objectC = objdiff(java.awt.Color.red, java.awt.Color.blue) objectC = Blue: {[0] [255]} RGB: {[-65536] [-16776961]} Red: {[255] [0]} >> objectC = objdiff(0,gcf) % 0 is the root handle objectC = children: {[2x1 struct] []} handle: {[0] [1]} properties: {[1x1 struct] [1x1 struct]} type: {'root' 'figure'} >> [objectC,IA,IB] = objdiff({2,3,4,7}, {2,4,5}) objectC = 3 5 7 IA = 2 4 IB = 3 See also: setdiff, setxor, isstruct, isjava, ishghandle, isobject, iscell, http://UndocumentedMatlab.com

** What is it?This convenience function allows you to quickly add a fit line to data after they have been plotted. e.g.>> plot(myData)>> out=addFitLine;Add fit line returns the fit parameters and handles to the plot objects. ** DetailsThe stats toolbox is required for the 'linear' and 'quadratic' options only.function out=addFitLine(poolFits,modelType,lineprops,ax) Purpose Add one or more fit lines to some or all data in axes "ax" or, without ax specified, to the current axes. Inputs *poolFits [optional 0 by default] - if 1 we fit a single line to all data series on the current axes. *modelType ['linear' by default] - If 'linear' it fits a straight line using the regress function from the stats toolbox. If 'quadratic' it fits a second-order polynomial using regress. The output from regress is returned. If modelType is an integer, the function fit a polynomial of this order using polyfit, which is not part of the stats toolbox. The output of polyfit is then returned. *lineprops [optional 'b-' by default] *ax [optional - gca by default] Outputs out - the fit parameters and plot handles Examples clf %Fit two seperate lines subplot(1,3,1), hold on, x=-5:0.1:5; y=1+1*x+randn(size(x))*2; plot(x,y,'.k') y=2-4*x+randn(size(x))*2; plot(x,y,'.r') H=addFitLine %Fit one line to two sets of data subplot(1,3,2), hold on x=-5:0.2:0; y=0.3*x+randn(size(x))*2; plot(x,y,'.k') x=0:0.2:5; y=0.3*x+randn(size(x))*2; plot(x,y,'.r') H=addFitLine(1) %Fit one quadratic subplot(1,3,3) x=-5:0.1:5; y=2+0.3*x+0.5*x.^2+randn(size(x))*2; plot(x,y,'.k') addFitLine([],'quadratic') OR: addFitLine([],2) Rob Campbell - December 2009

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

This function reads EDF+ files extremely quickly and with specific times and channels without putting unwanted information into memory. MemReadEDF leverages the memmap function to map the EDF+ file on disk where it can then be indedxed and put into memory for further analysis. This also cuts down on unnecessary computational time by reading the entire file and greatly reducing the time it takes to read a file.Please help me improve this EDF+ reader. Please feel free to contact me by email or in the reviews if there is anything that isn't working when you use this script on your particular file.EDFhdr = MemReadEDF(EDFfile) A single output request will only read the EDF+ header information and return it as a struct. No signal data will be outputed in the header.EDFhdr = MemReadEDF(EDFfile, 'annotations') Including the optional annotations argument will read the annotations in the EDF+ file and return them in the header structure.[EDFhdr, EDFdata] = MemReadEDF(EDFfile) Including the secondary output will return the signal data from the EDF+ file. If no other inputs are provided it will return the entire signal record associated with the EDF+ file (all times and all channels)[EDFhdr, EDFdata] = MemReadEDF(EDFfile, 'time', [0 60], 'channels', [1:12], 'annotations') Currently there are 3 optional parameters provided for reading information from the EDF+ file. The 'time' and 'channels' inputs require their values after the call as seen above. The call above will read the first 60 seconds of the recording for channels 1 through 12. Including the 'annotations' parameter will simply write the annotations to the struct header (EDFhdr).'time': you can ask for any time periode you would like in seconds. Thetime will start at time 0 and go until the end of the file. If you want everything from time 100 to the end of the file but do notknow then end of the file you can simpling run the following: [EDFhdr, EDFdata] =MemReadEDF(EDFfile, 'time', [100, inf]).'channels': You can order the channels in any way you would like. Forexample if you wanted the 3rd channel first in the data records andthe 1st channel second you could write the following: [EDFhdr, EDFdata] =MemReadEDF(EDFfile, 'channels', [3, 1]).'annotations': Asking for annotations will greatly increase the amount of time it takes to run a file depending on the length of the file, the amount of annotations or how they are saved.If there are any compatability issues or questions feel free to contact me.

Fisher's Exact Probability Test for a RxC matrix.Fisher's exact test permits calculation of precise probabilities in situation where, as a consequence of small cell frequencies, the much more rapid normal approximation and chi-square calculations are liable to be inaccurate. The Fisher's exact test involves the computations of several factorials to obtain the probability of the observed and each of the more extreme tables. Factorials growth quickly, so it's necessary use logarithms of factorials. This computations is very easy in Matlab because: x!=gamma(x+1) and log(x!)=gammaln(x+1). Moreover, when the matrix has many Rows and Columns, the computation of all the set of possible matrices is very time expensive. This function uses this strategy: if the input is a 2x2, 2x3, 2x4 or 3x3 matrix it uses (or download) ad hoc, previously written by me, function; else it uses a Monte Carlo approach. Finally, this function uses the Peter J. Acklam rldecode function, and so I want to acknowledge him. Created by Giuseppe Cardillo giuseppe.cardillo-edta@poste.itTo cite this file, this would be an appropriate format: Cardillo G. (2010) MyFisher: the definitive function for the Fisher's exact and conditional test for any RxC matrix http://www.mathworks.com/matlabcentral/fileexchange/26883

Supercolorbar is an alternative function to colorbar. It creates a color scale with more editable properties, including shape of extension (pointy or rounded ends), border width, tick style, face transparency, custom labels, label offset and label rotation.

I've found a series of functions (`cell2csv`) that writes cell array content in to a *.csv file.All of these functions is inefficient to handle a large cell array (number of nows > 20000), and none can handle a nD cell array.So, I created this function fcell2csv that adopts c-mex file to improve performance.`fcell2csv` is about 40~90 times faster than the codes found in FEX !NOTE!The c-mex file is necessary.Run the following code to compile.mex cell2csv_mex.c -R2018a -ORun the following code for comparison. x = [{'This', 'is', 'a', 'cell', 'time', 'test.'}; num2cell([(1:50000)', rand(50000,5)])];% Compare to built-in `writecell`/ `cell2csv`tic; writecell(x, 'writecell.csv'); t1 = toctic; cell2csv('cell2csv.csv', x); t2 = toc % removing loop % https://www.mathworks.com/matlabcentral/fileexchange/73240-faster-cell-array-to-csv-file-more-improved-cell2csv-mtic; cell2csv('cell2csv.csv', x); t3 = toc % https://www.mathworks.com/matlabcentral/fileexchange/47055-cell-array-to-csv-file-improved-cell2csv-mtic; fcell2csv('fcell2csv.csv', x); t4 = toc % my c-mexOn my notebook (i7-8550u)t1~33.127151 secondst2~8.365726 secondst3~11.168033 secondst4~0.513955 secondsWIN!!

Given as input a column vector of symbolic or anonymous functions (1x1, 2x1, ...), "Jac" will give as output the Jacobian of the vector inserted.The output format will be the same as the input format (anonymous => anonymous / sym => sym).If the input is a vector of anonymous functions, the Jacobian will be a vector/matrix of anonymous vectorized functions (the ' . ' is inserted before the following operations ' / ' ' * ' ' ^ ').This function uses the symbolic Math Toolbox. Examples and more informations are inserted in the comment section of "Jac"; type in the command window: >> help Jac

Differential constraints of wheels put the State-dependent Riccati equation (SDRE) controller into uncontrollability conditions. Since the actuators of wheels are not directly related to coordinates of the base, a proper kinematic transformation in design provided that relation; as a result, controllability of the controller over mobile robot needs to be obtained. This code presents the dynamics, state-space representation, and control of the mobile robots with differential wheels. For understanding the code and notations, you may read to the following paper: Korayem, M. H., Nekoo, S. R., & Korayem, A. H. (2016). Finite time SDRE control design for mobile robots with differential wheels. Journal of Mechanical Science and Technology, 30(9), 4353-4361.

This file computes the surface area of any surf object

"find_replace_system" will search and replace almost anyblock/annotation/signal property in Simulink. Ref: Simulink API documentation "find_system". Please refer the syntax and examples below. Syntax: >>find_replace_system('',,'','','','prompt') >>find_replace_system('','','','','prompt') >>find_replace_system('','','','') - Refer help find_system of all different types of properties can be used to narrow down the search, 'LookUnderMasks', 'RegExp', 'SearchDepth', 'FollowLinks', etc.. - 'prompt' is an optional keyword. Example: >>find_replace_system('sldemo_autotrans','LookUnderMasks','all','FindAll','on','type','block','Name','Transmission','AutoTransmission','prompt') >>find_replace_system('sldemo_autotrans','ForegroundColor','Red','Blue') >>find_replace_system('sldemo_clutch/Friction Mode Logic','Position',get_param('sldemo_clutch/Friction Mode Logic','Position'),[250 292 400 433],'prompt') >>find_replace_system(gcs,'SampleTime','-1','0.1','prompt') >>find_replace_system(gcs,'Amplitude','3','1.5') >>find_replace_system(gcs,'ZeroCross','on','off','prompt') Developed by: Sysenso Systems, www.sysenso.comPlease share your comments and suggestions. If you are interested to have GUI based Find and Replace Tool which has more features, please write to us contactus@sysenso.com

This function creates a slider GUI with editable parameters for min, max, value, stepsize but also the callback function itself. This is particularly useful for analysing the sensitivity of a function to a specific parameter as editslider allows to 'zoom' into a parameter range, where a higher resolution is required - without the need to restart another slider.The actual slider value is stored in a global variable to allow easy access from the command line or other GUIs or functions.

TLDECCHECK: Checks the TickLabels of all axes objects of the current figureand adjusts the amount of decimals so that they are uniform.Syntax: TLDECCHECK - adjusts the decimals automatically. TLDECCHECK('OptionName', OptionValue)OptionName - OptionValue pairs: - 'axes' - Axes handle, e.g. TLDECCHECK('axes', gca) (default: array containing all axes objects in gcf) - 'xNumDecimals' - Specifies the number of decimals the XTickLabels should be set to (numeric). - 'yNumDecimals' - Specifies the number of decimals the YTickLabels should be set to (numeric). - 'cNumDecimals' - Specifies the number of decimals the colorbar TickLabels should be set to (numeric). - 'xMode' - 'auto' (default) or 'manual' - Set this to 'manual' for reduction of the XTickLabel decimals through manual input. Doing so overrides the 'numDecimals' option. - 'yMode' - 'auto' (default) or 'manual' - Set this to 'manual' for reduction of the YTickLabel decimals through manual input. Doing so overrides the 'numDecimals' option. - 'cMode' - 'auto' (default) or 'manual' - Set this to 'manual' for reduction of the colorbar TickLabel decimals through manual input. Doing so overrides the 'numDecimals' option. - 'xLabelUnits' - Specify a custom unit (default: '%') that the XTickLabels are checked for (string). - 'yLabelUnits' - Specify a custom unit (default: '%') that the YTickLabels are checked for (string). - 'cLabelUnits' - Specify a custom unit (default: '%') that the colorbar TickLabels are checked for (string).Old syntax: (still works) TLDECCHECK - adjusts the decimals automatically. TLDECCHECK(nd) - adjusts the decimals and reduces the amount of decimals to nd TLDECCHECK('manual') - reduction of the decimals through manual inputInput arguments (old syntax): - nd: Amount of decimals for TickLabels (optional) -> Integer, for use on all axes objects -> String, 'manual', to set number of decimals for each axes object separatelyHint: - If using the 'manual' option, invisible axes objects may be found. Just input a random number if this happens.Author: Marc Jakobi - 22.01.2016

% ResCpRatio.m % This script compute the ratio of the residual specific heat capacity to % the universal gas constant using Hall and yarborough correlation for % compresibility factor. % % Pr = pseudoreduced pressure; % Tr = pseudoreduced temperature; % Written by Lateef Kareem - 10/09/2022 % All equations programed are from the paper in the link below % https://www.researchgate.net/profile/Lateef_Kareem/publication/235961260_Specific_Heat_Capacity_of_Natural_Gas_Expressed_as_a_Function_of_Its_Specific_gravity_and_Temperature/links/57dfabfa08ae5292a37f7fd3/Specific-Heat-Capacity-of-Natural-Gas-Expressed-as-a-Function-of-Its-Specific-gravity-and-Temperature.pdf

write3mfWRITE3MF: Writes 3mf file from vertices, faces and optionally colors.3mf file is the "3D Manufacturing Format" of file that will allow design applications to send full-fidelity 3D models to a mix of other applications, platforms, services and printers. Full description and specifications can be found here: https://3mf.io/I wrote this function because 3mf files can be imported in Powerpoint 365 ProPlus 2016 as 3D objects which can be manipulated live!This function creates a simple 3mf file structure, embedding the vertices, faces and colors provided.Syntax: write3mf(filename , vertices , faces, colors)Inputs: filename - output 3mf file vertices - list of unique vertices, Nx3 coordinates faces - connection matrix, Mx3 triangular mesh colors - (optional) RGB color for each vertex, Nx3 values (between 0 and 1 OR between 0 and 255) Demo mode:write3mf(filename , 'demo') will create a demo 3mf fileExample:vertices = [0 0 0; 10 0 10; 10 10 0; 0 10 10]; faces = [1 3 4; 2 3 4; 1 2 4; 1 4 3;]; write3mf('D:\temp\pyramid_vertexcolor.3mf' , vertices , faces)

String interpolation (see https://en.wikipedia.org/wiki/String_interpolation) is a much more convenient way to include data in strings than what fprintf provides, or than concatenating bits of string:fprintf puts the stuff being replaced into the string far away from where it will be replaced, making the resuling code hard to read.Concatenating strings has become a bit easier since the string type was introduced, but still requires a lot of quotes.String interpolation exists in many languages, but not in MATLAB. Hopefully some day MATLAB will have an interpolated string type. Until then, you can choose to use this function.If you want, you can rename the function to have a shorter name, so it's easier to use. For example, you could call it f, to match Python's syntax for interpolated strings:>> f = @interpolate_string;For example:>> disp("cos(4) = " + cos(4) + ", didn't you know?")cos(4) = -0.65364, didn't you know?>> fprintf("cos(4) = %f, didn't you know?\n", cos(4))cos(4) = -0.653644, didn't you know?>> disp(f("cos(4) = {cos(4)}, didn't you know?"))cos(4) = -0.6536, didn't you know?Some more examples:>> f = @interpolate_string;>> s = 3.4; p = 'foo'>> f("The value of s is {s}, and that of p is {p}!")ans = "The value of s is 3.4000, and that of p is foo!">> f("The value of s is {s}, \{this is not replaced}.")ans = "The value of s is 3.4000, {this is not replaced}."Note! This function is not fast. Use it for convenient syntax, but don't expect a performance similar to fprintf.

This function returns true if a field exists at a specific location within the struct. This is useful if you want to know if a field exists only within one position in the struct, especially for non-scalar structs. Use existField if you want to know about one specific location in a struct, e.g. if you want to know if a.b.c exists but don't care if a.c exists, and for non-scalar structs. This is in contrast to existing options such as hasfield and isfieldrecursive, which examine the struct as a whole with no specificity for one specific struct location, and also do not handle non-scalar fields.existField Syntax:boolean=existField(struct,path,varargin);% Inputs:% struct: The structure to look in (struct)% path: The path name to the field to check for (char)% varargin: Variables for dynamic path names (char) or dynamic indexing (numeric) % NOTE: Must be in the same order that they appear in the struct path% Outputs:% boolean: true if the field exists at the specified location, false if not (boolean)existField Examples:% Create a sample structurestruct.a(1).b=1;struct.b(1,2).c=1;struct.d(2).e=1;fldName='b'; % Dynamic field namenum=1; % Dynamic index% Examples that return true.existField(struct.a,'b'); % The same as the builtin isfieldexistField(struct,'struct.a.b'); % Check a subfield within the struct by specifying its full locationexistField(struct,'struct.d(2).e'); % Hard-coded vector indexingexistField(struct,'struct.d(num).e',num); % Dynamic vector indexingexistField(struct,'struct.b(num,2).c',num); % Mix of hard-coded & dynamic matrix indexingexistField(struct,'struct.(fldName)(1,2).c',fldName); % Dynamic field name with hard-coded indexingexistField(struct,'struct.(fldName)(num,2).c',fldName,num); % Dynamic field name and dynamic indexing% Examples that return false.existField(struct.b,'e'); % The same as the builtin isfieldexistField(struct,'struct.b.e'); % Check a subfield within the struct by specifying its full locationexistField(struct,'struct.d(3).e'); % Hard-coded vector indexing. size(struct.d,1)<3existField(struct,'struct.d(num).e',3); % Dynamic vector indexing. size(struct.d,1)<3existField(struct,'struct.b(num,2).c',3); % Mix of hard-coded & dynamic matrix indexing. size(struct.b,1)<3existField(struct,'struct.(fldName)(3,2).c',fldName); % Dynamic field name with hard-coded indexing. size(struct.b,1)<3existField(struct,'struct.(fldName)(3,num).c',fldName); % Dynamic field name and dynamic indexing. size(struct.b,1)<3hasfield and isfieldrecursive do not handle non-scalar structs:% Adapted from isfieldrecursive FileExchange descriptionmyStructure.a(1).calibration1.left.fc = 1;myStructure.a(2).calibration2.right.fc = 1;myStructure.a(3).calibration3.centre.fc = 1;% Returns false because it can't be indexedisfieldRecursive(myStructure,'a','calibration3','centre')% Returns true because index is specifiedexistField(myStructure,'myStructure.a(3).calibration3.centre')% Adapted from hasfield FileExchange descriptiond.b.d.b(2).a.waldo = 'where?'d.b.d.b(1).a.nowaldo='nowhere'% Throws an error! Doesn't handle non-scalar structs[x,L] = hasfield(d,'waldo')% Returns true, as it shouldexistField(d,'d.c.d.b(2).a.waldo')% Returns true and L=1 because it doesn't distinguish between fields of the same name at different levels[x,L] = hasfield(d,'b')

`float_params` is a MATLAB function for obtaining the parameters of severalfloating-point arithmetics. The parameters are built into the code and arenot computed at run time.The parameters are- the unit roundoff,- the smallest positive (subnormal) floating-point number,- the smallest positive normalized floating-point number,- the largest floating-point number,- the number of binary digits in the significand (including the implicit leading bit)and the arithmetics supported are - bfloat16,- IEEE half precision (fp16),- IEEE single precision (fp32),- IEEE double precision (fp64),- IEEE quadruple precision (fp128).The code was developed in MATLAB R2018b and works with versions at leastback to R2016b.

Use tags in code comments to create notes/todos and display links to them in the command window.TODOS: Similar to Matlab's TODO/FIXME report generator. Audits a file, folder, folder + subdirectories or the Matlab search path for tags created in code by commenting and displays them (as links to the matlab files) in the command window. Syntax: TODOS; searches the current directory and its subdirectories for TODO tags.TODOS(TAG) searches the current directory and its subdirectories for tags specified by TAG. TAG can be a string or a cell array of strings.TODOS(TAG, DIRNAME) scans the specified folder and its subdirectories.TODOS(TAG, FILENAME, 'file') scans the matlab file FILENAME.TODOS(TAG, DIRNAME, OPTION) specifies where to scan: OPTION == 'file' -> treats DIRNAME as a FILENAME OPTION == 'dir' -> scans the folder without subdirectories OPTION == 'all' -> scans the entire Matlab search path OPTION == 'subdirs' -> scans DIRNAME and its subdirectories

Function cleans and prepare dataset for text analysis by removing stopwords, punctuations, special chracters, emojis, hashtags, short words of 2 characters and long words of 16 characters. It prepare dataset for sentiment analysis by converting text into stem form and into lower case.

ANN of a Fischer Speedmax 3D Classic Plus 902 197Ski-camber profile f(x,m,x_m) for a given x-coordinate, load-mass and location.

function [CC,criteria]=findICI(G)Returns in CC all the pairings which satisfy the necessary condition for integrity (ICI) derived fron the Niederlinski Index. This function can be applied to square systems with a maximum size of 8x8. The input "G" must be a square matrix of real values which represents the dc-gain of the system. "CC" is a matrix, where each of the rows represents a pairing. For a given row, the value of the i-th element is the index of the input which is paired with the i-th output (see example below). "criteria" is a quantification of the level of the interaction of the pairings. The k-th element in the criteria vector is associated to the pairing represented by the k-th row of CC. For each pairing, the quantification used is the sum of all the considered elements in the Relative Interaction Array accumulated for all the possible partially controlled systems. Example: Consider the following DC-gain system fot a Petlyuk distillation column used in by K.E. Haeggblom (1997)with four inputs u1,u2,u3,u4 and four outputs y1,y2,y3,y4. G=[153.45, -179.34, 0.23, 0.03; -157.67, 184.75, -0.10, 21.63; 24.63, -28.97, -0.23, -0.1; -4.8, 6.09, 0.13, -2.41];Calling to these function returns the calue of "CC": CC= [3 4 1 2; 1 2 3 4]The first row of CC represents the paring y1-u3, y2-u4, y3-u1, y4-u2. The second row of CC represents the diagonal pairing y1-u1, y2-u2, y3-u3, y4-u4. The returned value of criteria is: criteria= [29.2847, 117.7139], indicating that the first pairing is preferred, since the second pairing presents a larger amount of interaction.

emgr - the EMpirical GRamian framework enables the computations of empirical system gramian matrices for nonlinear and parametric systems. In system theory and control engineering, (empirical) system Gramians have applications in model reduction, decentralized control, sensitivity analysis, parameter identification or optimal placement. For more information see: https://gramian.de

clarke_REGA Performs Clarke Rate Error Grid Analysis (REGA) The Clarke rate error grid approach is used to assess the clinical significance of differences between the glucose measurement technique under test and the venous blood glucose reference measurements. Zone A (acceptable) represents the glucose rates that deviate from the reference rate by +-10%. The values within this range are considered as clinically accurate. B (benign errors) is located above and below zone A; this zone represents those rates that deviate from the reference rates, by +-20%. The values that fall within zones A and B are clinically acceptable, whereas the rates included in areas C (over correction), D (failure to detect) and E (erroneous readings) are potentially dangerous, and there is a possibility of making clinically significant mistakes. SYNTAX: [total, percentage, indZone, h] = clarke_REGA(y, yp, flagFig, threshold) INPUTS: y Reference rates yp Predicted/estimtated rates flagFig [OPTIONAL] Flag for plotting the Clarke error grid figure: 1 : with figure 0 : without figure (default) threshold [OPTIONAL] The threshold used to define zone A in the REGA; the default is 1 mg/dl/min. OUTPUTS: total Total points per zone: total(1) = zone A, total(2) = zone B, and so on percentage Percentage of data which fell in certain region: percentage(1) = zone A, percentage(2) = zone B, and so on. indZone Indicators of zones for each sample h [OPTIONAL] Handle of the figure (if plotted) EXAMPLE: y = randn(1000, 1) *2; yp = randn(1000, 1) *2; [tot, per, ind, h] = clarke_REGA(y,yp,1,1); Modified from the codes by Edgar Guevara https://www.mathworks.com/matlabcentral/fileexchange/20545-clarke-error-grid-analysis MATLAB Version: 9.9.0.1538559 (R2020b) Update 3

Calculates the co-factors (signed minors) of each element of a matrix

Matlab function which imports the 'readed' or 'unreaded' outlook emails from inbox and their folders - subfolders.Extracts their subjects, bodies and can save their attachments.% Reads all emails from inboxmails = ReadOutlook;% Reads all Unread emails from inboxmails = ReadOutlook('Read', 1);% Reads all Unread emails from inbox and mark them as readmails = ReadOutlook('Read', 1, 'Mark', 1);% Reads all emails from a email folders and save their attachmentsmails = ReadOutlook('Folder', 'Groups', 'Savepath', 'C:\matlab\data\test');

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

Calculation of the Partial Relative Gain defined by K.E. Haeggblom (1997) in the paper titled: "Partial relative gain: a new tool for control structure selection"Illustrative examples with a Petlyuk distillation column are included. The examples reproduce the ones used by K.E. Haeggblom (1997).

Interpolate the -positions of roots/sign changes in the data in . This is helpful if you want to treat the positive and negative parts of y differently.Example: has three roots at , and . The vector x = linspace(-3, 3, 50)does not include these roots.y = x.^3 - 4.*x;[xNew, yNew] = interpolateRoots(x, y)interpolates the roots to , and and returns the extended vectors xNew and yNew including these interpolated roots at the corresponding positions. xNew and yNew are 53 elements long while x and y contain 50 elements.

The program computes and plots the orthonormal basis for the input vectors with flexible but uniform dimensions.