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 183917

Submitted on 1 Jan 2013

Incorrect

142Size
Leading solution size is 70.
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
 
%%
L1 =  [0 0;
       2 2];
L2 =  [0 1;
       2 1];
[L3,L4] = cross2kiss(L1,L2);
L3c = [0 0;
       1 1;
       2 1]
L4c = [0 1;
       1 1;
       2 2]
assert(isequal(L3,L3c))
assert(isequal(L4,L4c))
Error: Assertion failed.
2
Fail
 
%%
L1 =  [-2 -1;
        2  1];
L2 =  [-1  1;
        1 -1];
[L3,L4] = cross2kiss(L1,L2);
L3c =  [-2 -1;
         0  0;
         1 -1];
L4c =  [-1  1;
         0  0;
         2  1];
assert(isequal(L3,L3c))
assert(isequal(L4,L4c))
Error: Assertion failed.
3
Fail
 
%%
L1 =  [ 5  5;
        8 -4];
L2 =  [ 5 -2;
        9  0];
[L3,L4] = cross2kiss(L1,L2);
L3c =  [ 5 -2;
         7 -1;
         8 -4];
L4c =  [ 5  5;
         7 -1;
         9  0];
assert(isequal(L3,L3c))
assert(isequal(L4,L4c))
Error: Assertion failed.