matlab/matlab-agentic-toolkit / skills-catalog/control-systems/matlab-extract-battery-features
matlab-extract-battery-features
VerifiedExtract battery features in MATLAB from voltage, current, and temperature measurements: multi-cycle cycling tests, HPPC / pulse tests, EIS impedance sweeps, or a single in-field charge or discharge segment. Use when the user asks for battery features, or for SOH, RUL, degradation, internal-resistance, or impedance analysis that needs them. Output is a feature table; does not train SOH / RUL models. Do not trigger only because battery data is present. Triggers on battery* functions such as batteryTestDataParser, batteryTestFeatureExtractor, batteryPulseFeatures, batteryEISFeatures.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 21.6 KB |
| manifest.yaml | config | 469 B |
| references/cycling-pipeline.md | markdown | 21.1 KB |
| references/cycling/feature-selection.md | markdown | 2.6 KB |
| references/cycling/multi-cell.md | markdown | 5.1 KB |
| references/cycling/postprocess.md | markdown | 2.4 KB |
| references/cycling/schedule-verification.md | markdown | 4.2 KB |
| references/cycling/tolerance-tuning.md | markdown | 2.4 KB |
| references/eis-features.md | markdown | 10.8 KB |
| references/individual-cycling-functions.md | markdown | 10.1 KB |
| references/parameter-tuning.md | markdown | 14.2 KB |
| references/pulse-features.md | markdown | 12.6 KB |
| scripts/checkCyclingProtocol.m | other | 9.2 KB |
| scripts/sweepScheduleAndReport.m | other | 3.7 KB |
| scripts/verifyAgainstSchedule.m | other | 8.5 KB |
| scripts/verifySegmentation.m | other | 6.3 KB |
| scripts/verifySingleSegment.m | other | 3.0 KB |
scripts/verifySingleSegment.m
View on GitHubfunction report = verifySingleSegment(data, kind, opts)
%verifySingleSegment Preflight-check a single charge or discharge segment.
% report = verifySingleSegment(data, kind) confirms that a single-segment
% table matches the assumptions of the individual cycling functions
% (batteryMeasurementFeatures, batteryDifferentialCurves) before those
% functions are invoked.
%
% Required Inputs:
% data - Table of one segment (single charge or discharge)
% kind - "CC", "single-phase", or "any"
%
% Name-Value Arguments:
% CurrentVariable - Name of current column (default: "Current")
% VoltageVariable - Name of voltage column (default: "Voltage")
% RSDCurrentCC - RSD threshold below which current is flat
% (default 0.01)
% RestCurrent - |median(I)| below which segment is Rest
% (default 1e-4 A)
%
% Output:
% report - struct with fields:
% .Kind - the requested kind
% .Passed - true iff the requested check(s) all passed
% .Reasons - string array of failure descriptions (empty on pass)
% .Metrics - struct with rsdI, medianI, monotonicV, signChanges
arguments
data table
kind (1,1) string {mustBeMember(kind, ["CC","single-phase","any"])}
opts.CurrentVariable (1,1) string = "Current"
opts.VoltageVariable (1,1) string = "Voltage"
opts.RSDCurrentCC (1,1) double {mustBePositive} = 0.01
opts.RestCurrent (1,1) double {mustBePositive} = 1e-4
end
I = data.(opts.CurrentVariable);
V = data.(opts.VoltageVariable);
metrics.medianI = median(I);
metrics.rsdI = std(I) / max(abs(metrics.medianI), eps);
metrics.monotonicV = all(diff(V) >= 0) || all(diff(V) <= 0);
nonRestMask = abs(I) >= opts.RestCurrent;
signI = sign(I(nonRestMask));
if isempty(signI)
metrics.signChanges = 0;
else
metrics.signChanges = sum(abs(diff(signI)) > 0);
end
reasons = strings(0, 1);
if kind == "CC" || kind == "any"
if abs(metrics.medianI) < opts.RestCurrent
reasons(end+1, 1) = sprintf( ...
"median current |%.2e A| below RestCurrent threshold — segment looks like rest, not CC", ...
metrics.medianI);
end
if metrics.rsdI >= opts.RSDCurrentCC
reasons(end+1, 1) = sprintf( ...
"RSD of current %.3f exceeds threshold %.3f — current is not flat", ...
metrics.rsdI, opts.RSDCurrentCC);
end
if ~metrics.monotonicV
reasons(end+1, 1) = "voltage is not monotonic — CC segment must not reverse direction";
end
end
if kind == "single-phase" || kind == "any"
if metrics.signChanges > 0
reasons(end+1, 1) = sprintf( ...
"sign of current flips %d time(s) — segment contains both charge and discharge", ...
metrics.signChanges);
end
end
report.Kind = kind;
report.Passed = isempty(reasons);
report.Reasons = reasons;
report.Metrics = metrics;
end
% Copyright 2026 The MathWorks, Inc.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |