MATLAB TIPS
2.64K subscribers
82 photos
2 files
12.7K links
Matlab的一些现成脚本、函数,前人写的技巧、教程、文档。 Just tricks that finally work or what have learnt through search engines.受限于个人领域和Matlab水平,诚邀频道管理者;只要在使用Matlab过程中顺手把用上的网页、帖子发上来就好,十分简单。请联系 @MatLabTipsBot。#MATLAB
Download Telegram
📡 MATLAB Central - File Exchange - rating:4.7 | Introduction to Kalman Filter and Its Applications

# Kalman_Filter## OverviewMATLAB tutorial examples of the Kalman filter (KF) and extended Kalman filter (EKF) for INS/GNSS navigation, target tracking, and terrain-referenced navigation (TRN, also called terrain-aided navigation).These are the authors' implementations accompanying the **peer-reviewed tutorial chapter** Introduction to Kalman Filter and Its Applications, with source and terrain data available directly in this repository. See the chapter citation, implementation map, and provenance.The accompanying tutorial chapter has received **over 500 citations** on https://scholar.google.com/citations?view_op=view_citation&hl=en&user=8b6KtGYAAAAJ&citation_for_view=8b6KtGYAAAAJ:hC7cP41nSMkC">Google Scholar.For implementations in Python, C++, or other languages, follow the KF equations, EKF update procedure, and terrain measurement model.## MethodPredict the state and covariance with a motion model, then correct them using measurements. The linear KF uses position/velocity observations; the EKFs linearize angle/range or terrain-height observations around the current estimate.### Algorithms and source| Method and application | Chapter | Implementation and runnable example | Technical reference ||---|---|---|---|| Linear KF: inertial/GNSS position and velocity | Sections 2.2-2.3, Eqs. (3)-(18) | KF.m | Kalman filter || EKF: angle/range target tracking | Sections 3.2-3.3.1, Eqs. (23)-(32) | EKF_1.m | Extended Kalman filter || EKF: terrain-referenced navigation | Sections 3.2, 3.3.2, Eqs. (33)-(40) | EKF_2.m | Terrain navigation |## ExamplesRun commands from the repository root with MATLAB and Statistics and Machine Learning Toolbox (normrnd). The shell commands use matlab -batch (R2019a or later); the terrain example uses the included DEM.mat.Generate current-code versions of all seven simulation figures as PNG and PDF files:``bashmatlab -batch "generate_figures"`Generate one figure, such as Figure 5:`bashmatlab -batch "generate_figures(5)"`See the figure map and export options for Figures 1-5, 8, and 9, seeds, and output metadata. The exporter uses the current equations and simulation settings.Run the seeded introductory INS/GNSS example without opening figure windows:`bashmatlab -batch "set(groot,'defaultFigureVisible','off'); main; disp(x_RMSE(:,end))"`In an interactive MATLAB session, select the repository root as the current folder and enter main to see the plots. The scripts clear their calling workspace and close existing figures; save work before running them.See Examples for the two EKF commands, outputs, seeds, and terrain-data conventions.## Implementation scopeEach script contains its model, simulation, filter updates, and plotting code. Current source includes covariance and measurement corrections, with settings and numerical assumptions documented for adaptation.### ChecksRun the focused example and figure checks:`bashmatlab -batch "addpath('tests/integration/examples'); verify_examples; verify_figures"``These check example outputs, deterministic reruns, terrain loading, and figure export.## CitationFor academic attribution, please acknowledge this repository when adapting its code or examples.If you use or adapt these methods or examples, please cite:> Youngjoo Kim and Hyochoong Bang. “Introduction to Kalman Filter and Its Applications.” In Introduction and Implementations of the Kalman Filter. IntechOpen, 2018. https://doi.org/10.5772/intechopen.80600">doi:10.5772/intechopen.80600.Machine-readable software and chapter metadata are in CITATION.cff.## License and provenanceThe license specifies the copyright and redistribution conditions. Citation requests are separate from those license conditions.See provenance for source-distribution and dataset details, and implementation notes for model and numerical choices.
---------
🖼 NSFW Remover - 自动删除群组中的不当内容。
📡 MATLAB Central - File Exchange - rating:5.0 | PHX Toolbox

PHX is an object-oriented physics engine for MATLAB. Scenes are built from objects such as bodies, shapes, joints, springs, force fields and can be drawn directly into MATLAB axes. Toolbox includes MATLAB API, Simulink block, documentation and examples. MATLAB R2025a or newer is required.
Please open Telegram to view this post
VIEW IN TELEGRAM
📡 MATLAB Central - File Exchange - rating:5.0 | Laplacian in 1D, 2D, or 3D

This MATLAB/Octave-compatible code computes analytically **exact eigenpairs of the negative Laplacian operator** in 1D, 2D, or 3D on a rectangular finite-difference grid. It supports a wide range of boundary condition combinations: **Dirichlet (D)**, **Neumann (N)**, and **Periodic (P)**. The first mandatory output is the **sparse Laplacian matrix itself** via Kronecker sums of 1D discrete Laplacians. The actual numerical entries of the matrix fit int8 format, but only double data class is yet supported for sparse matrices in MATLAB.References- https://en.wikipedia.org/wiki/Eigenvalues_and_eigenvectors_of_the_second_derivative">Eigenvalues and eigenvectors of the second derivative- https://en.wikipedia.org/wiki/Kronecker_sum_of_discrete_Laplacians">Kronecker sum of discrete LaplaciansExamplesCompute both matrix and eigenpairs for a 3D Laplacian with mixed boundary conditions:[A, lambda, V] = laplacian([100, 45, 55], {'DD', 'NN', 'P'}, 20); Compute only the matrix:A = laplacian([100, 45, 55], {'DD', 'NN', 'P'}); Features- Supports **Dirichlet** , **Neumann** , and **Periodic** BCs (including mixed combinations)- Computes eigenvalues and eigenvectors analytically using Kronecker structure- Builds the Laplacian matrix directly- Compatible with **GNU Octave**Related Projects. This code is a part of the **BLOPEX eigensolver package:**- https://en.wikipedia.org/wiki/BLOPEX">Wikipedia: BLOPEX- GitHub BLOPEX Repository that also includes tests and solversNotesThe Python multidimensional code in SciPy https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.LaplacianNd.html">LaplacianNd — SciPy Manualsupports arbitrary dimensions, but it does **not yet support mixed boundary conditions**.Being superseded by MATLAB Sparse nD Laplacian with analytic eigenpairs. that supports arbitrary dimensions and mixed boundary conditions on opposite faces.Authors- Bryan C. Smith- Andrew V. Knyazev
---------
🔀 Routify — 在 Telegram 聊天之间自动转发消息。
📡 MATLAB Central - File Exchange - rating:5.0 | gearsInMesh

This MATLAB library provides a set of functions for working with involute gears. It allows you to:- Calculate involute gear geometry- Plot a single gear- Plot multiple gears in mesh- Animate gears in meshThe functions support both involute spur gears and helical involute gears.**Graphics dependency**For graphical output, the library uses the draw19 package, which is available on MATLAB File Exchange:https://www.mathworks.com/matlabcentral/fileexchange/71745-draw19Please install draw19 and add it to your MATLAB path before using the visualization and animation functions.**User guide**A quick user guide describing the workflow and main functions is available here:https://www.researchgate.net/publication/334065197\_MATLAB\_program\_for\_calculating\_the\_geometry\_of\_involute\_gearsThis toolbox can be useful for education, demonstration of gear meshing, and preliminary analysis of gear geometry.
Please open Telegram to view this post
VIEW IN TELEGRAM
📡 MATLAB Central - File Exchange - rating:5.0 | DataHash

DATAHASH - Hash for Matlab array, struct, cell or file Hash = DataHash(Data, Opts, ...) Data: Array of built-in types (U)INT8/16/32/64, SINGLE, DOUBLE (real or complex) CHAR, LOGICAL, CELL, STRUCT (scalar or array, nested), function\_handle. Options: List of char vectors: Hashing method: 'SHA-1', 'SHA-256', 'SHA-384', 'SHA-512', 'MD2', 'MD5'. Output format: 'hex', 'HEX', 'double', 'uint8', 'base64' Input type: 'array': The contents, type and size of the input [Data] are considered for the creation of the hash. Nested CELLs and STRUCT arrays are parsed recursively. Empty arrays of different type reply different hashs. 'file': [Data] is treated as file name and the hash is calculated for the files contents. 'bin': [Data] is a numerical, LOGICAL or CHAR array. Only the binary contents of the array is considered, such that e.g. empty arrays of different type reply the same hash. 'ascii': Same as 'bin', but only the 8-bit ASCII part of the 16-bit Matlab CHARs is considered. Hash: String or numeric vector. EXAMPLES: Default: MD5, hex: DataHash([]) % 7de5637fd217d0e44e0082f4d79b3e73SHA-1, Base64: S.a = uint8([]); S.b = {{1:10}, struct('q', uint64(415))}; DataHash(S, 'base64', 'SHA-1') % ZMe4eUAp0G9TDrvSW0/Qc0gQ9/AComparison with standard hash programs using ASCII strings: DataHash('abc', 'SHA-256', 'ascii')Michael Kleder's "Compute Hash" works similar, but does not accept structs, cells or files: http://www.mathworks.com/matlabcentral/fileexchange/8944"GetMD5" is 2 to 100 times faster, but it replies only MD5 hashes and a C-compiler is required: http://www.mathworks.com/matlabcentral/fileexchange/25921Tested: Matlab 7.7, 7.8, 7.13, 8.6, 9.1, 9.5, Win7&10/64, Java: 1.3, 1.6, 1.7Bugreports and enhancement requests are welcome. Feel free to ask me about a version for Matlab 6.5.PS. MD5 and SHA1 hash values are "broken": You can construct a data set, which has a specific hash. But to check the integrity of files or to to recognize a set of variables, both methods are reliable.See also Stefano Pradella's expanded version at: https://github.com/stefanopradella/DataHash
---------
🎤 What's The Song — 通过片段识别任何歌曲。
Please open Telegram to view this post
VIEW IN TELEGRAM
📡 MATLAB Central - File Exchange - rating:4.8 | Locally Optimal Block Preconditioned Conjugate Gradient

### Titlelobpcg — Locally Optimal Block Preconditioned Conjugate Gradient eigensolver### Short Summarylobpcg computes a few extreme eigenpairs of large Hermitian standard and generalized eigenproblems using a block preconditioned conjugate gradient method. It supports matrix and function-handle operators, optional constraints, optional preconditioning, and iteration histories for convergence analysis. Tested in GNU Octave Version: 11.3.0 and MATLAB with Parallel Computing Toolbox 26.2 (R2026b), but is expected to work on any post 2008 MATLAB and Octave.### Descriptionlobpcg is an iterative eigensolver for large-scale Hermitian problems where forming a full factorization is impractical. It is designed to compute partial spectra efficiently, especially for sparse matrices and operators supplied as functions or function handles.The solver accepts:- a full or sparse initial block of vectors,- a Hermitian operator A,- optional generalized operator B,- optional preconditioner T,- optional constraint vectors Y,- tolerance, iteration limit, and verbosity settings.It returns orthonormalized eigenvectors, the corresponding eigenvalues, a convergence flag, and optional histories of eigenvalue estimates and residual norms.### Features- Standard and generalized Hermitian eigenproblems- Block iterations for clustered and repeated eigenvalues- Optional preconditioning- Optional orthogonality constraints- Supports matrix, function-name, and function-handle operators- Works with sparse and full inputs- Residual and eigenvalue history output for diagnostics- Pure MATLAB (GNU Octave compatible) code- Support for MATLAB distributed or codistributed arrays- Support for double. single, and complex data types - Suitable for MATLAB and GNU Octave workflows### Typical Use CasesThis solver is useful for:- structural mechanics and vibration modes,- graph and network spectral problems,- repeated or clustered eigenvalue problems,- efficient preconditioning available,- large problems where MATLAB's built-in eig is too expensive and eigs is not the desired workflow.### Notes- A does not need to be positive definite- The code computes the algebraically smallest eigenvalues but can trivially be used for the largest simply applied to -A.- B and T should be positive definite when used. There is no check, and the code may break otherwise.- The code is intended for partial eigensolutions, not high-precision full diagonalization.- Performance and convergence depend on block size, preconditioner quality, and the spectral distribution.### Other implementations- A simplified C-version of this code is a part of thehttps://github.com/lobpcg/blopexpackage and is directly available, e.g., in SLEPc and HYPRE.- A Python version LOBPCG is inhttps://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.lobpcg.html- LOBPCG is implemented in many open-source packages in various languages for a great variety of applications; see https://en.wikipedia.org/wiki/LOBPCG- https://mfem.org/examples/ Maxwell Eigenproblem LOBPCG run generates the image used to identify this package.### ReferenceA. V. Knyazev, “Toward the Optimal Preconditioned Eigensolver: Locally Optimal Block Preconditioned Conjugate Gradient Method,” SIAM Journal on Scientific Computing, 23(2), 517–541, 2001.### Docstring%LOBPCG solves Hermitian partial eigenproblems using preconditioning%% [blockVectorX,lambda]=lobpcg(blockVectorX,operatorA)%% outputs the array of algebraic smallest eigenvalues lambda and% corresponding matrix of ortho-normalized eigenvectors blockVectorX of the% Hermitian (full or sparse) operator operatorA using input matrix% blockVectorX as an initial guess, without preconditioning, somewhat% similar to%% opts.issym=1;opts.isreal=1;K=size(blockVectorX,2);% [blockVectorX,lambda]=eigs(operatorA,K,'SR',opts);%% for real symmetric operator operatorA, or%% K=size(blockVectorX,2);[blockVectorX,lambda]=eigs(operatorA,K,'SR');% for
---------
🔀 Routify — 在 Telegram 聊天之间自动转发消息。
Please open Telegram to view this post
VIEW IN TELEGRAM
📡 MATLAB Central - File Exchange - rating:5.0 | HTTP Progress Bar

Download files from the web and upload files to the web while showing live progress, using MATLAB's HTTP interface. Progress is shown in a waitbar, in a progress dialog attached to an app figure, or in the Command Window. It includes the transferred size, the percentage and an estimate of the remaining time.
---------
🤖 Mad AI Bot — 您的个人 AI 助手、图像生成器和编辑器。
Please open Telegram to view this post
VIEW IN TELEGRAM
📡 MATLAB Central - File Exchange - rating:5.0 | Fluorescence Tracker App

# Fluorescence Tracker App https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg">![Open in MATLAB Online](https://matlab.mathworks.com/open/github/v1?repo=mathworks/Fluorescence-Tracker-App)This app uses computer vision point tracking to quantify near infrared signals emitted by (ICG) Indocyanine Green during fluorescence angiography. Short overview videos of how to use this app can be found in the https://www.mathworks.com/videos/series/how-to-video-series-for-biomedical-and-pharmaceutical-applications.html">"How To" Video Series for Biomedical and Pharmaceutical Applications.!Fluorescence Tracker AppThe following research in colorectal cancer was carried out using this software: "Digital dynamic discrimination of primary colorectal cancer using systemic indocyanine green with near-infrared endoscopy" by J. Dalli et al., Scientific Reports 11, Article 11349
---------
🔀 Routify — 在 Telegram 聊天之间自动转发消息。
Please open Telegram to view this post
VIEW IN TELEGRAM
📢 Advertising in this channel

You can place an ad via Telega․io. It takes just a few minutes.

Formats and current rates: View details
📡 MATLAB Central - File Exchange - rating:5.0 | Simple Robotics Toolbox

This is a simple robotics toolbox designed to study and understand the forward kinematics of robot manipulators. Unlike Peter Corke's toolbox, the representation is not done automatically through the Denavit Hartenberg representation, but the homogeneous transformations are at the user's discretion and therefore the representation is built by the user. This feature enables to represent the kinematic diagram of parallel robots, such as the paralelogram configuration in the Fanuc Robots.All the elements of any kinematic diagram can be represented with solid parts (3D frames, joints and links). The solid links need STL files. If you don't need the representation of solid links, these can be represented with simple lines.The toolbox needs the next included complementary toolboxes/functions:\* FreezeColors toolbox by John Iversen (2005)\* Stlread and patchslim functions by Francis Esmonde-White (2010).A
---------
🛡 ChatZilla — 您的群组的审核机器人。
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
📡 MATLAB Central - File Exchange - rating:5.0 | CSV files Processing for MoCap with Optitrack

This could be considered as a toolbox for extracting and animating MoCap data obtained from Optitrack's Motive. The file named "csv2struc.m" reads a ".csv" file exported from Motive, for extracting its basic information. This toolbox processes data exported only in Markersets and not in Rigid Bodies or Skeletons. The file named "plotmarkers.m" is a function for animating that MoCap data from "csv2strc". Example files included.
---------
🔀 Routify — 在 Telegram 聊天之间自动转发消息。
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM