Question: Write a user-defined MATLAB function that determines the circumference of a triangle when the coordinates of the vertices are given. For the function name and

Write a user-defined MATLAB function that determines the circumference of a triangle when the coordinates of the vertices are given. For the function name and arguments, use [cr] = cirtriangle (A, B, C). The input arguments A, B, C are vectors with the coordinates of the vertices, and the output variable cr is the circumference. The function should work for a triangle in the x-y plane (each vertex is defined by two coordinates) or for a triangle in space (each vertex is defined by three coordinates). Write the code of cirtriangle such that it has a subfunction or an anonymous function for calculating the distance between two points. Use the function to determine the circumference of triangles with the following vertices:
(a) A = (1, 2), B = (10, 3), C = (6, 11)
(b) A = (-1.5, -4.2, -3), B = (-5.1, 6.3, 2), C = (12.1, 0, -0.5)

Step by Step Solution

3.39 Rating (168 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Script file clear clc dispPart a A12 B103 C611 cr cirtriangleABC fprintfThe perimete... View full answer

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

Document Format (1 attachment)

Word file Icon

652-B-F-F-M (735).docx

120 KBs Word File

Students Have Also Explored These Related Finance Questions!