Cody

Solution 2196892

Submitted on 7 Apr 2020
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
filetext = fileread('xy_dstnc.m'); assert(isempty(strfind(filetext, 'dist')))

2   Fail
m=5; Start=rand(m,2); Final=rand(m,2); d=xy_dstnc(Start,Final); d=round(100*d)/100; d_expect=zeros(m); for i=1:m % 10 for j=1:m dx=Start(i,1)-Final(j,1); % 14 dy=Start(i,2)-Final(j,2); % 14 d_expect(i,j)=hypot(dx,dy); % 14 end end d_expect=round(100*d_expect)/100; assert(isequal(d_expect,d))

d = 0.6951 d = 0.6951 0.6167 d = 0.6951 0.6167 0.6102 d = 0.6951 0.6167 0.6102 0.5040 d = 0.6951 0.6167 0.6102 0.5040 0.8204 d = 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 d = 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 d = 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 d = 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 d = 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 d = 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 d = 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 d = 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 d = 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 0.3170 d = 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 0.3170 0.7273 d = 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 0.3170 0.7273 0.6682 d = 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 0.3170 0.7273 0.6682 0.5570 d = 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 0.3170 0.7273 0.6682 0.5570 0.6138 d = Columns 1 through 18 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 0.3170 0.7273 0.6682 0.5570 0.6138 Column 19 0.5504 d = Columns 1 through 18 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 0.3170 0.7273 0.6682 0.5570 0.6138 Columns 19 through 20 0.5504 0.8256 d = Columns 1 through 18 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 0.3170 0.7273 0.6682 0.5570 0.6138 Columns 19 through 21 0.5504 0.8256 0.7535 d = Columns 1 through 18 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 0.3170 0.7273 0.6682 0.5570 0.6138 Columns 19 through 22 0.5504 0.8256 0.7535 0.7295 d = Columns 1 through 18 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 0.3170 0.7273 0.6682 0.5570 0.6138 Columns 19 through 23 0.5504 0.8256 0.7535 0.7295 0.6211 d = Columns 1 through 18 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 0.3170 0.7273 0.6682 0.5570 0.6138 Columns 19 through 24 0.5504 0.8256 0.7535 0.7295 0.6211 0.4413 d = Columns 1 through 18 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 0.3170 0.7273 0.6682 0.5570 0.6138 Columns 19 through 25 0.5504 0.8256 0.7535 0.7295 0.6211 0.4413 0.8192 d = Columns 1 through 18 0.6951 0.6167 0.6102 0.5040 0.8204 0.2377 0.1594 0.4479 0.6952 0.5160 0.7228 0.7598 0.5511 0.3170 0.7273 0.6682 0.5570 0.6138 Columns 19 through 25 0.5504 0.8256 0.7535 0.7295 0.6211 0.4413 0.8192

Assertion failed.