Cody

# Problem 1370. Derivative of polynomial

Solution 2927335

Submitted on 9 Sep 2020 by Benjamin
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   Pass
%p = 4x^4 + 3x^3 + x + 19 x=[4 3 0 1 19] y_correct = [16 9 0 1] assert(isequal(your_fcn_name(x),y_correct))

x = 4 3 0 1 19 y_correct = 16 9 0 1

2   Pass
%p = 5x^6 + 3x^4 + 8x^2 + 1 x=[5 0 3 0 8 0 1] y_correct = [30 0 12 0 16 0] assert(isequal(your_fcn_name(x),y_correct))

x = 5 0 3 0 8 0 1 y_correct = 30 0 12 0 16 0

3   Pass
x=[[3 zeros(1,399) 15 zeros(1,100)]] y_correct = [1500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] assert(isequal(your_fcn_name(x),y_correct))

x = Columns 1 through 30 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 31 through 60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 61 through 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 91 through 120 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 121 through 150 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 151 through 180 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 181 through 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 211 through 240 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 241 through 270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 271 through 300 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 301 through 330 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 331 through 360 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 361 through 390 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 391 through 420 0 0 0 0 0 0 0 0 0 0 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 421 through 450 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 451 through 480 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 481 through 501 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y_correct = Columns 1 through 15 1500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 16 through 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 31 through 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 46 through 60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 61 through 75 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 76 through 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 91 through 105 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 106 through 120 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 121 through 135 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 136 through 150 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 151 through 165 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 166 through 180 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 181 through 195 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 196 through 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 211 through 225 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 226 through 240 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 241 through 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 256 through 270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 271 through 285 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 286 through 300 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 301 through 315 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 316 through 330 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 331 through 345 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 346 through 360 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 361 through 375 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 376 through 390 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 391 through 405 0 0 0 0 0 0 0 0 0 0 1500 0 0 0 0 Columns 406 through 420 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 421 through 435 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 436 through 450 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 451 through 465 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 466 through 480...

4   Pass
x=[1 -2 3 -4 -3 2 -1] y_correct = [6 -10 12 -12 -6 2] assert(isequal(your_fcn_name(x),y_correct))

x = 1 -2 3 -4 -3 2 -1 y_correct = 6 -10 12 -12 -6 2

### Community Treasure Hunt

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

Start Hunting!