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 373988

Submitted on 23 Dec 2013 by J-G van der Toorn

Correct

26Size
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
Pass
 
%%
p1=[1 2 3];
p2=[2 4 6];
y_correct = true;
assert(isequal(isparallel(p1,p2),y_correct))

                    
2
Pass
 
%%
p1=[1 2 3];
p2=[2 5 6];
y_correct = false;
assert(isequal(isparallel(p1,p2),y_correct))

                    
3
Pass
 
%%
p1=[666 911];
p2=[0.1 0.1*911/666];
y_correct = true;
assert(isequal(isparallel(p1,p2),y_correct))

                    
4
Pass
 
%%
p1=[1 2 3];
p2=[0 0 0];
y_correct = false;
assert(isequal(isparallel(p1,p2),y_correct))