Matlab program help.

6 views (last 30 days)
Anon
Anon on 29 Mar 2011
Hey everyone, I'm new to the website as well as Matlab and I don't understand some problems. If anyone is able to help that would be greatly appreciated. I am taking a computer class at my college, however being a biology major I am not very good with computers. Please help.
#1 The distance between any two points (x1, y1) and (x2, y2) is given by Distance = Squareroot((x1-x2)^2+(y1-y2)^2) The area of a triangle is: Area = Squareroot(S*(S-a)*(S-b)*(S-c)) where a, b, and c are the lengths of the sides of the triangle, and s is equal to half the sum of the lengths of the three sides of the triangle. Write a script that will prompt the user to enter the coordinates of three points that determine a triangle(e.g., the x and y coordinates of each point). The script will then calculate and print the area of the triangle. It will call one function to calculate the area of the triangle. This function will call a subfunction, which calculates the length of the side formed by any two points (the distance between them).
  1 Comment
Walter Roberson
Walter Roberson on 30 Mar 2011
Please be more specific about what you would like to know.

Sign in to comment.

Answers (2)

Harsha Vardhan Rao  Avunoori
The task is a relatively simple one but I didn't understand what do you want to enter as inputs ??? x1 y1 or a b c ???
  1 Comment
Anon
Anon on 30 Mar 2011
Inputs for the 3 points to make the triangle. So it's (x1,y1),(x2,y2) etc

Sign in to comment.


Matt Fig
Matt Fig on 30 Mar 2011
Generally, folks here will not do your homework for you. Please make an attempt at the code, and when you get stuck come back for help on a specific issue related to how to do a specific task in MATLAB.
Show what you try, and ask for help on where you get stuck. You will find lots of help when you put some effort into it too.

Community Treasure Hunt

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

Start Hunting!