% isTriangle first checks to see whether the entered sides can create a
% triangle, then checks to see what type of triangle it is
% clean up
clear all;
close all;

% get side lengths from user
s1 = input('Please enter the length of side 1: ');
s2 = input('Please enter the length of side 2: ');
s3 = input('Please enter the length of side 3: ');

% create vector of side lengths
sides = [s1 s2 s3];

% check sides
if ((s1+s2+s3)-max(sides)) > max(sides)
    if s1 == s2 && s2 == s3
        fprintf('The sides form an equilateral triangle\n');
    elseif s1 == s2 || s1 == s3 || s2 == s3
        fprintf('The sides form an isosceles triangle\n');
    else
        fprintf('The sides form a scalene triangle\n');
    end
else
    fprintf('The sides do not form a triangle\n');
end