Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 295299

Submitted on 2 Aug 2013

Incorrect

14Size
Leading solution size is 11.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Fail
 
%%
x=[0:10]
y=[12:12:132]
xdash=6.6
ydash = 91.2;
assert(isequal(Lookup(x,y,xdash),ydash))
Error: Assertion failed.
2
Pass
 
%%
x=[1:10]
y=[10:20:200]
xdash=7.2
ydash = 134;
assert(isequal(Lookup(x,y,xdash),ydash))
x =
     1     2     3     4     5     6     7     8     9    10
y =
    10    30    50    70    90   110   130   150   170   190
xdash =
    7.2000