Cody

Solution 1871500

Submitted on 11 Jul 2019
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   Fail
p0 = [0 0 0]; p1 = [1 1 1]; p2 = [2 2 2]; p3 = [3 3 3]; t0 = 0; t1 = 1; d = 1; ok = true; assert(isequal(safetrip(d, t0, t1, p0, p1, p2, p3), ok))

line_ship = 1 1 1 line_ast = 1 1 1

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in safetrip (line 6) perp_line=line_ship*line_ast Error in Test1 (line 9) assert(isequal(safetrip(d, t0, t1, p0, p1, p2, p3), ok))

2   Fail
p0 = [3 3 3]; p1 = [2 2 2]; p2 = [2 2 2]; p3 = [3 3 3]; t0 = 0; t1 = 1; d = 1; ok = false; assert(isequal(safetrip(d, t0, t1, p0, p1, p2, p3), ok))

line_ship = -1 -1 -1 line_ast = 1 1 1

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in safetrip (line 6) perp_line=line_ship*line_ast Error in Test2 (line 9) assert(isequal(safetrip(d, t0, t1, p0, p1, p2, p3), ok))

3   Fail
p0 = [1 2 3]; p1 = [4 5 6]; p2 = [3 2 1]; p3 = [6 5 4]; t0 = 10; t1 = 20; d = 2; ok = true; assert(isequal(safetrip(d, t0, t1, p0, p1, p2, p3), ok))

line_ship = 3 3 3 line_ast = 3 3 3

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in safetrip (line 6) perp_line=line_ship*line_ast Error in Test3 (line 9) assert(isequal(safetrip(d, t0, t1, p0, p1, p2, p3), ok))