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/sweepScheduleAndReport.m
View on GitHubfunction out = sweepScheduleAndReport(tbl, schedule, mapping, tolGrid)
%sweepScheduleAndReport Sweep Tolerance, classify cycles, and report.
% out = sweepScheduleAndReport(tbl, schedule, mapping, tolGrid) runs
% verifyAgainstSchedule at each Tolerance in tolGrid and classifies each
% cycle as neverPass, alwaysPass, or Tolerance-sensitive. Picks the
% largest Tolerance that satisfies every Tolerance-sensitive cycle and
% excludes neverPass cycles from downstream extraction.
%
% Inputs:
% tbl - cycling data table
% schedule - struct array (see verifyAgainstSchedule)
% mapping - struct with parser column mappings (see below)
% tolGrid - vector of Tolerance candidates, high → low
%
% mapping fields (all required):
% CurrentVariable, VoltageVariable, TimeVariable,
% CycleIndexVariable, StepIndexVariable, TemperatureVariable
arguments
tbl (:,:) table
schedule (1,:) struct
mapping (1,1) struct
tolGrid (1,:) double = [5e-5, 1e-5, 1e-6]
end
parser = @(tol) batteryTestDataParser(tbl, ...
CurrentVariable=mapping.CurrentVariable, ...
VoltageVariable=mapping.VoltageVariable, ...
TimeVariable=mapping.TimeVariable, ...
CycleIndexVariable=mapping.CycleIndexVariable, ...
StepIndexVariable=mapping.StepIndexVariable, ...
TemperatureVariable=mapping.TemperatureVariable, ...
Tolerance=tol);
cyc = unique(tbl.(mapping.CycleIndexVariable));
numCyc = numel(cyc);
passMap = false(numCyc, numel(tolGrid));
reports = cell(1, numel(tolGrid));
fprintf('Sweeping Tolerance over %d values on %d cycles...\n', numel(tolGrid), numCyc);
for i = 1:numel(tolGrid)
p = parser(tolGrid(i));
r = verifyAgainstSchedule(p, schedule);
reports{i} = r;
[~, ia, ib] = intersect(r.PerCycle.Cycle, cyc, 'stable');
passMap(ib, i) = r.PerCycle.AllStepsPass(ia);
fprintf(' Tol=%-8.0e passed %d/%d cycles\n', tolGrid(i), sum(passMap(:,i)), numCyc);
end
alwaysPass = all(passMap, 2);
neverPass = ~any(passMap, 2);
tolSensitive = ~alwaysPass & ~neverPass;
bestTol = NaN;
if any(tolSensitive)
for i = 1:numel(tolGrid)
if all(passMap(tolSensitive, i))
bestTol = tolGrid(i);
break
end
end
if isnan(bestTol)
[~, bi] = max(sum(passMap(tolSensitive, :), 1));
bestTol = tolGrid(bi);
fprintf('WARN: no single Tolerance satisfies every sensitive cycle. Picked best partial: %.0e\n', bestTol);
end
else
bestTol = tolGrid(1); % nothing sensitive — largest value works
end
excludedCycles = cyc(neverPass);
% Final verify at bestTol
finalParser = parser(bestTol);
finalReport = verifyAgainstSchedule(finalParser, schedule);
fprintf('\n=== Sweep-and-classify report ===\n');
fprintf('Cycles: %d total\n', numCyc);
fprintf(' Always pass: %d\n', sum(alwaysPass));
fprintf(' Tolerance-sensitive: %d\n', sum(tolSensitive));
fprintf(' Never pass (data issue): %d cycles: %s\n', sum(neverPass), mat2str(excludedCycles'));
fprintf('Selected Tolerance: %.0e\n', bestTol);
fprintf('Final pass count @bestTol: %d/%d\n', finalReport.PassCount, numCyc);
if ~isempty(excludedCycles)
fprintf('\nExcluded-cycle reasons (from bestTol verification):\n');
for c = excludedCycles'
row = finalReport.PerCycle(finalReport.PerCycle.Cycle==c, :);
if ~isempty(row)
fprintf(' Cycle %d: %s\n', c, row.FirstFailReason);
end
end
end
out.PassMap = passMap;
out.TolGrid = tolGrid;
out.BestTol = bestTol;
out.ExcludedCycles = excludedCycles;
out.AlwaysPass = cyc(alwaysPass);
out.TolSensitive = cyc(tolSensitive);
out.FinalReport = finalReport;
out.PerToleranceReports = reports;
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: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | 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 |