Cody

Problem 895. Generate N equally spaced intervals between -L and L

Solution 2981686

Submitted on 23 Sep 2020 at 2:10
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
y = your_fcn_name(100,100); assert( y(1) == -100 && y(end) == 100 && mean(diff(y))== 2 && std(diff(y)) == 0 );

y = -100 0 100

Assertion failed.

2   Fail
y = your_fcn_name(200,100); assert( y(1) == -100 && y(end) == 100 && mean(diff(y))== 1 && std(diff(y)) == 0 );

y = -100 100

Assertion failed.

3   Fail
y = your_fcn_name(2,100); assert( y(1) == -100 && y(end) == 100 && mean(diff(y))== 100 && std(diff(y)) == 0 );

y = Columns 1 through 29 -100 -98 -96 -94 -92 -90 -88 -86 -84 -82 -80 -78 -76 -74 -72 -70 -68 -66 -64 -62 -60 -58 -56 -54 -52 -50 -48 -46 -44 Columns 30 through 58 -42 -40 -38 -36 -34 -32 -30 -28 -26 -24 -22 -20 -18 -16 -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 Columns 59 through 87 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 Columns 88 through 101 74 76 78 80 82 84 86 88 90 92 94 96 98 100

Assertion failed.

Suggested Problems

More from this Author56

Community Treasure Hunt

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

Start Hunting!