Matlab program help.

2 次查看(过去 30 天)
Anon
Anon 2011-3-29
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 个评论
Walter Roberson
Walter Roberson 2011-3-30
Please be more specific about what you would like to know.

请先登录,再进行评论。

回答(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 个评论
Anon
Anon 2011-3-30
Inputs for the 3 points to make the triangle. So it's (x1,y1),(x2,y2) etc

请先登录,再进行评论。


Matt Fig
Matt Fig 2011-3-30
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.

类别

Help CenterFile Exchange 中查找有关 Performance and Memory 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by