Cody

# Problem 47048. Area of a triangle given its sides

Solution 3350603

Submitted on 23 Oct 2020 by Nikolaos Nikolaou
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
a = 5;b = 4;c = 3; y_correct = 6; assert(abs(AreaOfTriangle(a,b,c) - y_correct) < 1e-3)

t = 6 ans = 6

2   Pass
a = 10;b = 4;c = 3; y_correct = 'Not a triangle!'; assert(isequal(AreaOfTriangle(a,b,c),y_correct))

ans = 'Not a triangle!'

3   Pass
a = -5;b = 4;c = 3; y_correct = 'Not a triangle!'; assert(isequal(AreaOfTriangle(a,b,c),y_correct))

ans = 'Not a triangle!'

4   Pass
a = 0;b = 4;c = 3; y_correct = 'Not a triangle!'; assert(isequal(AreaOfTriangle(a,b,c),y_correct))

ans = 'Not a triangle!'

5   Pass
a = 4;b = 4;c = 3; y_correct = 5.5621; assert(abs(AreaOfTriangle(a,b,c) - y_correct) < 1e-3)

t = 5.5000 ans = 5.5621

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!