Error using cppelt - findchangepts function
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello everyone,
I need to get the breakpoints of a time series. I coded
bp = findchangepts(data,'MaxNumChanges',2);
However I obtained
Error using cppelt
The input data type must be either single or double precision
Error in findchangepts>cpmulti (line 241)
[cpmax, minresidue] = cppelt(x, 0, Lmin, statistic);
Error in findchangepts (line 76)
[cp, residue] = cpmulti(x, statistic, Lmin, Kmax);
Apparently, the problem is 'MaxNumChanges',2, because if I skip it, I get a result (only 1 breakpoint). My data type is double precision, so I don't understand what happens
Somebody could help me, please?
Thanks a lot
0 Kommentare
Antworten (1)
Star Strider
am 17 Apr. 2022
Your findchangepts call works correctly when I test it here —
t = linspace(0, 10);
data = +(t>4.5); % The '+' Converts 'logical' To 'double'
bp = findchangepts(data,'MaxNumChanges',2)
figure
plot(t, data, t(bp), data(bp), 'pg', 'MarkerSize',11)
grid
ylim([-0.1 1.1])
whos t data
.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Multirate Signal Processing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
