npx skills add ...
npx skills add matlab/matlab-agentic-toolkit --skill matlab-analyze-data
Analyze data using MATLAB. Use when the task involves tables, timetables, time-series data, numeric arrays, sensor matrices, or gridded data — including but not limited to exploring, row filtering, sorting, cleaning, transforming, aggregating, smoothing, padding, trimming, and answering questions about data. MATLAB provides extensive, easy-to-use built-in functions for these workflows with no additional products required.
npx skills add matlab/matlab-agentic-toolkit --skill matlab-analyze-data
Generate idiomatic MATLAB code for tabular data analysis tasks using tables and timetables.
matlab-build-chart instead)matlab-import-export-data instead)matlab-choose-big-data-solution instead)matlab-secure-credentials instead)matlab-use-database or matlab-use-duckdb instead)matlab-prepare-signal-data instead)matlab-classify-tabular-data instead)matlab-engineer-tabular-features instead)matlab-modernize-code instead)This skill covers core MATLAB functions for tabular, time-series, and array-based data workflows — including numeric arrays, sensor matrices, and gridded data. These functions work natively with table, timetable, and numeric arrays, handle missing data correctly, and are performance-optimized. Prefer the modern functions recommended here (e.g., groupsummary, datetime, fillmissing, smoothdata2) over legacy alternatives (e.g., accumarray, nanmean, datenum). Override only if the user explicitly requests otherwise.
Each section below links to a reference file. ALWAYS read the reference file for every relevant topic before writing code. Reference files contain correct syntax, common pitfalls, and "Avoid" patterns that prevent silent bugs. Skipping the reference risks using a deprecated approach or hitting a known pitfall. After reading, state Reference files read: [list] at the top of your response.
Most functions in this skill are available in R2023a or earlier. The following require a newer release:
| Function | Available From | Purpose |
|---|---|---|
paddata, trimdata, resize | R2023b | Pad, trim, or resize arrays to target length |
smoothdata2 | R2023b | Smooth 2-D gridded data over rectangular windows |
kde | R2023b | Kernel density estimate for univariate data |
clip | R2024a | Clamp values to a range |
islocalmax2, islocalmin2 | R2024a | Detect local extrema in 2-D gridded data |
summary (enhanced) | R2024b | Supports arrays (numeric, datetime, duration, logical); adds Statistics, DataVariables, Detail name-value args |
isapprox | R2024b | Tolerance-aware floating-point comparison (use instead of == for computed values) |
isbetween (numeric) | R2024b | Check elements within a numeric range |
numunique | R2025a | Count distinct values in a variable |
allbetween | R2025a | Validate all values are within a range |
allunique | R2025a | Validate all values are unique |
When data is already in a workspace variable, start by understanding its structure and contents before writing analysis code.
Topics:
Functions: summary, head, size, jsonencode, anymissing, allfinite, ismissing, groupcounts, numunique, allunique, kde, corrcoef, pivot, unique, isregular, isuniform, retime
Read: exploration.md
Use modern MATLAB types instead of legacy alternatives. Modern types are faster, more readable, and work better with table functions.
Topics:
Functions: datetime, dateshift, year, month, day, weekday, quarter, hour, timeofday, ymd, hms, hours, days, minutes, seconds, calmonths, caldays, string, matches, contains, startsWith, extractAfter, extractBefore, replace, erase, strip, split, count, categorical, mergecats, renamecats, removecats, reordercats, countcats
Read: data-types.md
Tables are the primary container for tabular data. Use timetable when the data has timestamps, a time vector, or a known sample rate — it unlocks time-aware operations (automatic spacing-aware smoothing, filling, and resampling).
Topics:
SamplePoints)timeseries objectsFunctions: table, timetable, table2timetable, vartype, convertvars, retime, synchronize, lag, timerange, withtol, timeseries2timetable, table2array, array2table
Read: tables-and-timetables.md
Use eventtable when tagging or annotating timetable rows with events, episodes, or phases (sensor anomalies, storms, maintenance windows, alarms). Do NOT add boolean columns, string labels, or categorical state variables to the timetable itself.
Topics:
Functions: eventtable, eventfilter, extractevents, syncevents, withtol, stackedplot
Read: eventtables.md
Handle missing values and outliers using MATLAB's built-in detection and fill functions. Never compare with == for missing values. Use standardizeMissing to convert sentinel values before filling or removing.
Topics:
Functions: ismissing, anymissing, standardizeMissing, fillmissing, rmmissing, isoutlier, rmoutliers, filloutliers, isbetween, allbetween, clip
Read: data-cleaning.md
Filter, sort, reshape, normalize, bin, join, and manage table variables. Use vectorized operations and built-in functions — not loops over rows or manual if-else chains.
Topics:
Functions: sortrows, topkrows, rowfun, varfun, convertvars, renamevars, movevars, addvars, removevars, splitvars, mergevars, discretize, normalize, clip, rescale, isapprox, isbetween, pivot, stack, unstack, rows2vars, innerjoin, outerjoin, join
Read: data-transformation.md
groupsummary is the go-to for grouped statistics — not findgroups+accumarray or manual loops. Use groupfilter for per-group row filtering, grouptransform for per-group normalization, and pivot for cross-tabulation.
Topics:
Functions: groupsummary, groupcounts, groupfilter, grouptransform, pivot, findgroups
Read: grouping-and-aggregation.md
smoothdata is the unified entry point for smoothing (not smooth, which requires Curve Fitting Toolbox). Use detrend or trenddecomp for trend removal/decomposition, and islocalmax/islocalmin/ischange for pattern detection.
Topics:
Functions: smoothdata, movmean, movmedian, detrend, trenddecomp, islocalmax, islocalmin, ischange, histcounts, histogram
Read: smoothing-and-trends.md
Use arrays when data is homogeneous numeric AND either naturally 2D/grid, performance-critical, or delivered by upstream tooling. For 2D grids, use dedicated 2D functions — do not loop 1D functions over rows/columns.
Topics:
Functions: smoothdata2, fillmissing2, islocalmax2, islocalmin2, paddata, trimdata, resize, mink, maxk, bounds, rms, prctile, quantile, iqr, cumsum, cummax, cummin, cumprod, movmean, movmedian, movsum, movstd, movvar, isuniform, isregular
Read: array-and-grid-data.md
When the task is answering a specific question about data (top-N, filtering, lookups, comparisons), read the strategies reference to avoid common mistakes with sorting direction, missing data, and value interpretation.
Topics:
Functions: topkrows, sortrows, groupsummary, standardizeMissing, isapprox, matches, contains, height, nnz
Read: answering-data-questions.md
Copyright 2026 The MathWorks, Inc.