Cody

# Problem 1370. Derivative of polynomial

Solution 1065717

Submitted on 28 Nov 2016 by Xiaoli Zhang
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 29 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 Columns 30 through 58 0 0 0 0 0 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 59 through 87 0 0 0 0 0 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 88 through 116 0 0 0 0 0 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 117 through 145 0 0 0 0 0 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 146 through 174 0 0 0 0 0 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 175 through 203 0 0 0 0 0 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 204 through 232 0 0 0 0 0 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 233 through 261 0 0 0 0 0 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 262 through 290 0 0 0 0 0 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 291 through 319 0 0 0 0 0 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 320 through 348 0 0 0 0 0 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 349 through 377 0 0 0 0 0 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 378 through 406 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 0 0 0 0 0 Columns 407 through 435 0 0 0 0 0 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 436 through 464 0 0 0 0 0 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 465 through 493 0 0 0 0 0 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 494 through 501 0 0 0 0 0 0 0 0 y_correct = Columns 1 through 14 1500 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 15 through 28 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 29 through 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 43 through 56 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 57 through 70 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 71 through 84 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 85 through 98 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 99 through 112 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 113 through 126 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 127 through 140 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 141 through 154 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 155 through 168 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 169 through 182 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 183 through 196 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 197 through 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 211 through 224 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 225 through 238 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 239 through 252 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 253 through 266 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 267 through 280 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 281 through 294 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 295 through 308 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 309 through 322 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 323 through 336 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 337 through 350 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 351 through 364 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 365 through 378 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 379 through 392 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 393 through 406 0 0 0 0 0 0 0 0 1500 0 0 0 0 0 Columns 407 through 420 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 421 through 434 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 435 through 448 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 449 through 462 0 0 0 0 0 0 0 0 0 0 0 0 ...

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