Matlab has a reputation for running slowly. Here are some pointers on how to speed computations, to an often unexpected degree. Subjects currently covered: Matrix Coding Implicit Multithreading on a Multicore Machine Sparse Matrices Sub-Block Computation to Avoid Memory Overflow Matrix Coding - 1 Matlab documentation notes that efficient computation depends on using the matrix facilities, and that mathematically identical algorithms can have very different runtimes, but they are a bit coy about just what these differences are. A simple but telling example: The following is the core of the GD-CLS algorithm of Berry et.al., copied from fig. 1 of Shahnaz et.al, 2006, "Document clustering using nonnegative matrix factorization': for jj = 1:maxiter A = W'*W + lambda*eye(k); for ii = 1:n b = W'*V(:,ii); H(:,ii) = A \ b; end H = H .* (H>0); W = W .* (V*H') ./ (W*(H*H') + 1e-9); end Replacing the columwise update of H with a matrix update gives: for jj = 1:maxiter A = W'*W + lambda*eye(k); B = W'*V; H = A \ B; H = H .* (H>0); W = W .* (V*H') ./ (W*(H*H') + 1e-9); end These were tested on an 8049 x 8660 sparse matrix bag of words V (.0083 non-zeros), with W of size 8049 x 50, H 50 x 8660, maxiter = 50, lambda = 0.1, and identical initial W. They were run consecutivly, multithreaded on an 8-processor Sun server, starting at ~7:30PM. Tic-toc timing was recorded. Runtimes were respectivly 6586.2 and 70.5 seconds, a 93:1 difference. The maximum absolute pairwise difference between W matrix values was 6.6e-14. Similar speedups have been consistantly observed in other cases. In one algorithm, combining matrix operations with efficient use of the sparse matrix facilities gave a 3600:1 speedup. For speed alone, C-style iterative programming should be avoided wherever possible. In addition, when a couple lines of matrix code can substitute for an entire C-style function, program clarity is much improved. Matrix Coding - 2 Applied to integration, the speed gains are not so great, largely due to the time taken to set up the and deal with the boundaries. The anyomous function setup time is neglegable. I demonstrate on a simple uniform step linearly interpolated 1-D integration of cos() from 0 to pi, which should yield zero: tic; step = .00001; fun = @cos; start = 0; endit = pi; enda = floor((endit - start)/step)step + start; delta = (endit - enda)/step; intF = fun(start)/2; intF = intF + fun(endit)delta/2; intF = intF + fun(enda)(delta+1)/2; for ii = start+step:step:enda-step intF = intF + fun(ii); end intF = intFstep toc; intF = -2.910164109692914e-14 Elapsed time is 4.091038 seconds. Replacing the inner summation loop with the matrix equivalent speeds things up a bit: tic; step = .00001; fun = @cos; start = 0; endit = pi; enda = floor((endit - start)/step)*step + start; delta = (endit - enda)/step; intF = fun(start)/2; intF = intF + fun(endit)*delta/2; intF = intF + fun(enda)*(delta+1)/2; intF = intF + sum(fun(start+step:step:enda-step)); intF = intF*step toc; intF = -2.868419946011613e-14 Elapsed time is 0.141564 seconds. The core computation take
Attribution-NonCommercial-NoDerivs 4.0 (CC BY-NC-ND 4.0)https://creativecommons.org/licenses/by-nc-nd/4.0/
License information was derived automatically
These data accompany the following manuscript: Wilson, L., Constantine, R., Pine, M.K. Farcas, A. Radford, C.A. Impact of small boat sound on the listening space of Pempheris adspersa, Forsterygion lapillum, Alpheus richardsoni and Ovalipes catharus. Sci Rep 13, 7007 (2023). https://doi.org/10.1038/s41598-023-33684-0
Please note that the functions find_closest4_fast.m, linterp.m, linterp2d.m, and extract_rec_value_update.m were provided by Charlotte Findlay and Adrian Farcas. Charlotte Findlay can be contacted at charlotte_findlay@hotmail.co.uk or charlotte.findlay@bio.au.dk.
The following required functions are available from the Matlab file exchange: Jonathan Sullivan (2023). Automatic Map Scale Generation (https://www.mathworks.com/matlabcentral/fileexchange/33545-automatic-map-scale-generation), MATLAB Central File Exchange. Retrieved April 28, 2023. Rafael Palacios (2023). deg2utm (https://www.mathworks.com/matlabcentral/fileexchange/10915-deg2utm), MATLAB Central File Exchange. Retrieved April 28, 2023. Rafael Palacios (2023). utm2deg (https://www.mathworks.com/matlabcentral/fileexchange/10914-utm2deg), MATLAB Central File Exchange. Retrieved April 28, 2023.
The required function PG_DFT.m accompanies the folllowing manuscript: Merchant, N. D., Fristrup, K. M., Johnson, M. P., Tyack, P. L., Witt, M. J., Blondel, P., & Parks, S. E. (2015). Measuring acoustic habitats. Methods in Ecology and Evolution, 6, 257–265. https://doi.org/10.1111/2041-210X.12330
Audiogram data can be obtained from the cited literature.
Please contact me with any questions: lwil634@aucklanduni.ac.nz.
This resource contains the experimental data that was included in tecplot input files but in matlab files. dba1_cp has all the results is dimensioned (7,2) first dimension is 1-7 for each span station 2nd dimension is 1 for upper surface, 2 for lower surface. dba1_cp(ispan,isurf).x are the x/c locations at span station (ispan) and upper(isurf=1) or lower(isurf=2) dba1_cp(ispan,isurf).y are the eta locations at span station (ispan) and upper(isurf=1) or lower(isurf=2) dba1_cp(ispan,isurf).cp are the pressures at span station (ispan) and upper(isurf=1) or lower(isurf=2) Unsteady CP is dimensioned with 4 columns 1st column, real 2nd column, imaginary 3rd column, magnitude 4th column, phase, deg M,Re and other pertinent variables are included as variables and also included in casedata.M, etc
Attribution 4.0 (CC BY 4.0)https://creativecommons.org/licenses/by/4.0/
License information was derived automatically
Matlab code and raw data
https://www.gnu.org/licenses/gpl.htmlhttps://www.gnu.org/licenses/gpl.html
Physiological waveforms - such as electrocardiograms (ECG), electroencephalograms (EEG), electromyograms (EMG) - are generated during the course of routine care. These signals contain information that can be used to understand underlying conditions of health. Effective processing and analysis of physiological data requires specialized software. The WaveForm DataBase (WFDB) Toolbox for MATLAB and Octave is a collection of over 30 functions and utilities that integrate PhysioNet's open-source applications and databases with the high-precision numerical computational and graphics environment of MATLAB and Octave.
Attribution 4.0 (CC BY 4.0)https://creativecommons.org/licenses/by/4.0/
License information was derived automatically
Instructions to read h5ad file in Matlab: A mat file of the complete lemur cell atlas dataset converted from the h5ad file is provided in the Figshare files. We also provide a Matlab script to import the h5ad file to mat file: please download the h5ad file of interest, Matlab script “LCA_h5ad2Mat.m” and Matlab function “read_csmatrix.m” to the same folder, and run “LCA_h5ad2Mat.m”. The mat file contains a single variable named “rawData”, a Matlab structure variable with the following fields:cells: a table of the sequenced cells with metadata for individual sequenced cells (features of the table includes above “/obs” and “/obsm” list for the h5ad file, e.g., cell_name, tissue, free_annotation_v1, and X_umap, but not the MHC counts which is included in tabMHC, see below).genes: gene tablename: NCBI gene symbol.highly_variable: whether the gene is highly variable (calculated for the entire dataset).mat_raw: a sparse matrix of the cell by gene transcript count (raw count).mat_X: a sparse matrix of the cell by gene transcript level after library size normalization and natural log transformation (i.e., smartseq2, ln(reads/N *1e4 +1); 10x, ln(UMI/N *1e4 +1), where N denotes the total number of reads or UMI of the cell).tabMHC: a table of the calculated raw counts for the major histocompatibility complex (MHC) genes (see the Tabula Microcebus manuscript for detail). Note the count is only available for cells sequenced by 10x method and count is NAN for cells sequenced by smartseq2 method. Both raw counts and normalized counts (labeled with prefix letter ‘n’) are provided.MHC_C_I, MHC_NC_I, MHC_all_II: sum of counts from classical Class I genes.nMHC_C_I, nMHC_NC_I, nMHC_all_II: sum of normalized counts from classical Class I genes.counts and normalized counts from individual classical Class I genes (Mimu_168, Mimu_W03, Mimu_W04, Mimu_249, nMimu_168, nMimu_W03, nMimu_W04, nMimu_249), non-classical Class I genes (Mimu_180ps, Mimu_191, Mimu_202, Mimu_208, Mimu_218, Mimu_229ps, Mimu_239ps, nMimu_180ps, nMimu_191, nMimu_202, nMimu_208, nMimu_218, nMimu_229ps, nMimu_239ps), and Class II genes (Mimu_DMA, Mimu_DMB, Mimu_DPA, Mimu_DPB, Mimu_DQA, Mimu_DQB, Mimu_DRA, Mimu_DRB, nMimu_DMA, nMimu_DMB, nMimu_DPA, nMimu_DPB, nMimu_DQA, nMimu_DQB, nMimu_DRA, nMimu_DRB). version: version of the data (name of the h5ad file converted from).
Attribution-NonCommercial-NoDerivs 4.0 (CC BY-NC-ND 4.0)https://creativecommons.org/licenses/by-nc-nd/4.0/
License information was derived automatically
EEG Data and MATLAB Scripts for Data Preprocessing, Frequency Domain Analysis, Functional Connectivity Analysis, and Plotting
CC0 1.0 Universal Public Domain Dedicationhttps://creativecommons.org/publicdomain/zero/1.0/
License information was derived automatically
Matlab scripts to plot model fit results + compute auxiliary analyses. These files are associated with the following published study: Trujillo & Anderson (in press). Facial typicality and attractiveness reflect an ideal dimension of face structure. Cognitive Psychology. https://doi.org/10.1016/j.cogpsych.2022.101541. Please properly cite all usage of the files. All version changes to date (12/22/2022) reflect uploading of new files created for revised analyses as part of the peer review of the associated manuscript.
Attribution 4.0 (CC BY 4.0)https://creativecommons.org/licenses/by/4.0/
License information was derived automatically
The MATLAB program provides the performance of a sliding window based detection for a pulse radar signal.
Attribution 4.0 (CC BY 4.0)https://creativecommons.org/licenses/by/4.0/
License information was derived automatically
Two folders are provided. The MATLAB folder contains MATLAB codes for running Kernel PLS cross-validation, calibration and prediction of properties in various data sets: corn, yerba, wheat and meat. The R folder contains the same data with R codes for the same activities.
CC0 1.0 Universal Public Domain Dedicationhttps://creativecommons.org/publicdomain/zero/1.0/
License information was derived automatically
These are the scripts used to import the empirical data and perform the fast fourier transform (FFT) analyses reported in Trujillo, Stanfield, & Vela (2017). The effect of electroencephalogram (EEG) reference choice on information-theoretic measures of the complexity and integration of EEG signals. Frontiers in Neuroscience, 11: 425. doi: 10.3389/fnins.2017.00425. Data is in Matlab M-files format. Also included are MS Word files explaining the scripts and the empirical data files, and MS Excel files containing the de-identified demographics of the study subjects and EEG trial information.
This dataset was created by Alhousainy Abderlahman
This dataset was developed as a means of identifying particular events during the SHEBA drift, and assembling in one place data necessary for driving and verifying ice ocean models. It does not include cloud or precipitation data. It does include data of the following types: meteorological, ice, sheba_gpsdata, turb_mast, profiler, ADP and bathymetry. Please see the Readme for more information.
https://spdx.org/licenses/MIT.htmlhttps://spdx.org/licenses/MIT.html
This is a Demo for the manuscript 'Efficient Update of Redundancy Matrices for Truss and Frame Structures' that demonstrates the speedup and accuracy of the proposed update formulas. The computation is done in single-precision. Please open and run the main file. Further information is contained in this file.
Attribution 3.0 (CC BY 3.0)https://creativecommons.org/licenses/by/3.0/
License information was derived automatically
These Matlab/Simulink Files were used to generate the plots for the submitted paper „Mathematical Modeling and Simulation of Thyroid Homeostasis: Implications for the Allan-Herndon-Dudley-Syndrome“.
To reproduce the plots, please execute the files in the following order: 1: MM_Parameters_Healthy.m 2: MM_Healthy.slx 3: MM_Parameters_ADHS.m 4: MM_AHDS.slx 5: MM_Plot_Results and analogously regarding the linear case.
Attribution 4.0 (CC BY 4.0)https://creativecommons.org/licenses/by/4.0/
License information was derived automatically
The uploaded .ZIP file contains the MATLAB codes used in Examples 1 and 2 of the following paper, which the authors have submitted to an IEEE Journal: Data-Driven Saturated State Feedback Design for Polynomial Systems Using Noisy Data. This is the abstract of the paper: "In this note, the problem of data-driven saturated state feedback design for polynomial nonlinear systems is solved by means of a sum-of-squares (SOS) approach. This new strategy combines recent results in dissipativity theory and data-driven feedback control using noisy input-state data. SOS optimization is also employed in this work to deliver an estimate of the closed-loop domain of attraction under saturated feedback. Numerical examples allow the reader to verify the usefulness of the proposed strategy, which is the first in literature to provide a data-driven and dissipativity-based approach for dealing with the problem of input saturation for continuous-time polynomial systems".
Attribution 4.0 (CC BY 4.0)https://creativecommons.org/licenses/by/4.0/
License information was derived automatically
This dataset includes the MATLAB codes for data analyzing of Run length measurement and MSD analysis.
MATLAB is the most powerful software for scientific research, especially for scientific data analysis. It is assumed that trainees have no prior programming expertise or understanding of MATLAB. The following lectures on MATLAB are available on YouTube for international learners. https://youtube.com/playlist?list=PL4T8G4Q9_JQ8jULIl_gFOzOqlAALmaV5Q My profile: https://researchsociety20.org/founder-and-director/
https://dataverse.tdl.org/api/datasets/:persistentId/versions/3.0/customlicense?persistentId=doi:10.18738/T8/KZLM7Lhttps://dataverse.tdl.org/api/datasets/:persistentId/versions/3.0/customlicense?persistentId=doi:10.18738/T8/KZLM7L
Matlab scripts used to produce the graphs in "Dust Charging in Dynamic Ion Wakes". An overview of each script and the data files it requires is given in "supporting_data_and_code.docx"
Scripts and data acquired at the Mirror Lake Research Site, cited by the article submitted to Water Resources Research: Distributed Acoustic Sensing (DAS) as a Distributed Hydraulic Sensor in Fractured Bedrock M. W. Becker(1), T. I. Coleman(2), and C. C. Ciervo(1) 1 California State University, Long Beach, Geology Department, 1250 Bellflower Boulevard, Long Beach, California, 90840, USA. 2 Silixa LLC, 3102 W Broadway St, Suite A, Missoula MT 59808, USA. Corresponding author: Matthew W. Becker (matt.becker@csulb.edu).
Matlab has a reputation for running slowly. Here are some pointers on how to speed computations, to an often unexpected degree. Subjects currently covered: Matrix Coding Implicit Multithreading on a Multicore Machine Sparse Matrices Sub-Block Computation to Avoid Memory Overflow Matrix Coding - 1 Matlab documentation notes that efficient computation depends on using the matrix facilities, and that mathematically identical algorithms can have very different runtimes, but they are a bit coy about just what these differences are. A simple but telling example: The following is the core of the GD-CLS algorithm of Berry et.al., copied from fig. 1 of Shahnaz et.al, 2006, "Document clustering using nonnegative matrix factorization': for jj = 1:maxiter A = W'*W + lambda*eye(k); for ii = 1:n b = W'*V(:,ii); H(:,ii) = A \ b; end H = H .* (H>0); W = W .* (V*H') ./ (W*(H*H') + 1e-9); end Replacing the columwise update of H with a matrix update gives: for jj = 1:maxiter A = W'*W + lambda*eye(k); B = W'*V; H = A \ B; H = H .* (H>0); W = W .* (V*H') ./ (W*(H*H') + 1e-9); end These were tested on an 8049 x 8660 sparse matrix bag of words V (.0083 non-zeros), with W of size 8049 x 50, H 50 x 8660, maxiter = 50, lambda = 0.1, and identical initial W. They were run consecutivly, multithreaded on an 8-processor Sun server, starting at ~7:30PM. Tic-toc timing was recorded. Runtimes were respectivly 6586.2 and 70.5 seconds, a 93:1 difference. The maximum absolute pairwise difference between W matrix values was 6.6e-14. Similar speedups have been consistantly observed in other cases. In one algorithm, combining matrix operations with efficient use of the sparse matrix facilities gave a 3600:1 speedup. For speed alone, C-style iterative programming should be avoided wherever possible. In addition, when a couple lines of matrix code can substitute for an entire C-style function, program clarity is much improved. Matrix Coding - 2 Applied to integration, the speed gains are not so great, largely due to the time taken to set up the and deal with the boundaries. The anyomous function setup time is neglegable. I demonstrate on a simple uniform step linearly interpolated 1-D integration of cos() from 0 to pi, which should yield zero: tic; step = .00001; fun = @cos; start = 0; endit = pi; enda = floor((endit - start)/step)step + start; delta = (endit - enda)/step; intF = fun(start)/2; intF = intF + fun(endit)delta/2; intF = intF + fun(enda)(delta+1)/2; for ii = start+step:step:enda-step intF = intF + fun(ii); end intF = intFstep toc; intF = -2.910164109692914e-14 Elapsed time is 4.091038 seconds. Replacing the inner summation loop with the matrix equivalent speeds things up a bit: tic; step = .00001; fun = @cos; start = 0; endit = pi; enda = floor((endit - start)/step)*step + start; delta = (endit - enda)/step; intF = fun(start)/2; intF = intF + fun(endit)*delta/2; intF = intF + fun(enda)*(delta+1)/2; intF = intF + sum(fun(start+step:step:enda-step)); intF = intF*step toc; intF = -2.868419946011613e-14 Elapsed time is 0.141564 seconds. The core computation take