Cody

Problem 561. Find the jerk

Solution 2164030

Submitted on 18 Mar 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
h = 0.065; % stepsize t = -10:h:10; for tr = 1:1000 sigCoefs = 2*rand(1,3)-1; sig = polyval(sigCoefs,t); breakPoint = randi(length(sig)-2)+1; sig(breakPoint) = (1.01)*sig(breakPoint); assert(any(abs(findAJerk(sig) - breakPoint)<=6)) % extra wide window out of kindness end

ans = Columns 1 through 17 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0 0.0000 -0.0000 Columns 18 through 34 0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 Columns 35 through 51 -0.0000 0.0000 0.0000 -0.0000 0 0 0.0000 -0.0000 0.0000 -0.0000 0 -0.0000 0 0.0000 -0.0000 -0.0000 0 Columns 52 through 68 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 Columns 69 through 85 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0 -0.0000 0.0000 -0.0000 0.0000 -0.0000 Columns 86 through 102 0 0.0000 0 -0.0000 0.0000 0 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 Columns 103 through 119 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 Columns 120 through 136 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 Columns 137 through 153 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 -0.0000 0 0.0000 -0.0000 0.0000 Columns 154 through 170 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 Columns 171 through 187 0.0000 0.0000 -0.0000 0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 Columns 188 through 204 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 Columns 205 through 221 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 Columns 222 through 238 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 Columns 239 through 255 0 0.0000 0 0 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 Columns 256 through 272 0.0000 0 -0.0000 0 0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0 -0.0000 0.0000 0 -0.0000 Columns 273 through 289 -0.0000 0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 Columns 290 through 305 -0.0000 0.0000 -0.0000 0.2519 -0.7556 0.7556 -0.2519 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 0.0000 -0.0000

Output argument "idx" (and maybe others) not assigned during call to "findAJerk". Error in Test1 (line 9) assert(any(abs(findAJerk(sig) - breakPoint)<=6)) % extra wide window out of kindness

Suggested Problems

More from this Author1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!