Question: Matlab coding help 2 I) The area of a triangle for which all side lengths are known can be found using the formula: A= S(S

Matlab coding help

Matlab coding help 2 I) The area of a triangle for which

2 I) The area of a triangle for which all side lengths are known can be found using the formula: A= S(S a)(S b)(S c) Where A is the area, a, b and c are the side lengths, and S has the following value: a + b + c 2 A novice programmer (not anyone from this class!) writes the following function to implement this calculation. Find the errors and suggest changes. function area = TriArea(a,b,c) % This function calculates the area of a triangle for which the side lengths are known. % Inputs: Side lengths of the triangle: a, b and c in meters % Output: Area of the triangle, in square meters A = sqrt(S)*(S-a)*(S-b)*(S-C); S = a + b+ c/2; II) function r = quadroots(a,b,c) % finds the roots of a quadratic polynomial ax^2 + bx + c = 0 posroot = (-b + sqrt(b^2 - 4ac)/(2a); negroot = (-b - sqrt(b^2 - 4ac)/(2a)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!