This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
y11 = [4 3 0 3];
y21 = [2 0 1 3];
x11 = [0 1 1 2];
x21 = [-2 4 1 2];
a1 = [-2 4 0 2];
assert(isequal(piecewise(x11, y11, x21, y21),a1))
|
2 | Fail |
y12 = [2 2 2 2];
y22 = [0 4 0 4];
x12 = [1 1 1 1];
x22 = [1 1 1 1];
a2 = [1 0 1 0];
assert(isequal(piecewise(x12, y12, x22, y22),a2))
|
3 | Fail |
y23 = [2 2 2 2];
y13 = [0 4 0 4];
x13 = [2 2 2 2];
x23 = [2 2 2 2];
a3 = [0 2 0 2];
assert(isequal(piecewise(x13, y13, x23, y23),a3))
|
4 | Fail |
y14 = zeros(1, 100);
y24 = ones(1, 100);
x14 = ones(1,100);
x24 = 2*ones(1,100);
a4 = zeros(1, 100);
assert(isequal(piecewise(x14, y14, x24, y24),a4))
|
5 | Fail |
y25 = 2;
y15 = 0;
x15 = 2;
x25 = 2;
a5 = 0;
assert(isequal(piecewise(x15, y15, x25, y25),a5))
|
401 Solvers
Generate a string like abbcccddddeeeee
234 Solvers
Is this triangle right-angled?
2874 Solvers
Matlab Basics - y as a function of x
339 Solvers
Replace every 3rd element in a vector with 4
170 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!