Cody

Problem 72. Interpolator

Solution 2038275

Submitted on 28 Nov 2019 by saeedeh ostovari
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
a = 3; alpha = 1 : 1 : 10; beta = 2 : 2 : 20; b = 6; out = interpolator(a, alpha, beta); assert(isequal(out(:), b))

i = 1 2 j = 4 5 6 7 8 9 10 x = 2 x = 2 4 y = 4 y = 4 8 vb = 6

2   Pass
a = 3.5; alpha = 1 : 1 : 10; beta = 2 : 2 : 20; b = 7; out = interpolator(a, alpha, beta); assert(isequal(out(:), b))

i = 1 2 3 j = 4 5 6 7 8 9 10 x = 3 x = 3 4 y = 6 y = 6 8 vb = 7

3   Pass
a = 3; alpha = [0 1 5 6 7 10]; beta = [2 3 5 7 9 100]; b = 4; out = interpolator(a, alpha, beta); assert(isequal(out(:), b))

i = 1 2 j = 3 4 5 6 x = 1 x = 1 5 y = 3 y = 3 5 vb = 4

Suggested Problems

More from this Author95

Community Treasure Hunt

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

Start Hunting!