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 407385

Submitted on 21 Feb 2014 by Mehmet OZC

Correct

68Size
Leading solution size is 27.
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
Pass
 
%%
a = [9 10 3 10 10; 10 7 6 2 5; 2 1 10 10 9];
b = [2 8 1; 5 10 9; 10 7 10];
d = [11.7473    5.0990   11.3578; ...
     12.2066    7.0000   12.8841; ...
      1.4142    7.0711    3.6056; ...
      8.5440    8.7750   11.4018; ...
      8.0623    5.7446    9.8995];
assert(all(all(abs(pairEuc(a,b)-d)<1e-4)))

                    
2
Pass
 
%%
a = [1 2; 3 4]';
b = [5 6; 7 8; 9 10]';
d = [5.6569    8.4853   11.3137;...
     2.8284    5.6569    8.4853];
assert(all(all(abs(pairEuc(a,b)-d)<1e-4)))