Computing all values for Width and Height

조회 수: 1 (최근 30일)
joe brady
joe brady 2020년 3월 12일
댓글: Jon 2020년 3월 13일
I am given a fixed Area, of which is 0.243. I am asked to compute all of the possible values for the Height (H) and width (W) which can equal this area. There is another constriction which says that Hmax is 1.25 and Wmin is 0.2, how would one go about this problem?
Thanks.

답변 (1개)

Jon
Jon 2020년 3월 12일
편집: Jon 2020년 3월 12일
Here are some hints:
So think about an equation that expresses the Area A in terms of H and W. Now you know A so if you specify either the values of H or the values W you can solve for the other.
So say you solve for H in terms of A and W. Then think about how you write that in MATLAB. So you want a line of code that can give you H given a value of W. Now you need to "feed" this expression some W values, so make a vector of W values, and then use your MATLAB expression to give you the H values. Finally you can plot H vs W using the MATLAB plot command.
You will have to work out the allowable range for W to make sure that H does not exceed the limiting value. That's just a little algebra.
Note that to be picky, when you say "all the possible values" there are an infinite number of them. You can plot a line though that gives you some of them.
  댓글 수: 2
joe brady
joe brady 2020년 3월 12일
Great thank you.
Jon
Jon 2020년 3월 13일
Glad that helped. Were you able to get your code running? If so, when you get a chance you could post your code here so others could see how you resolved it and mark the question as answered so people will know that an answer is available. If you post your code, you can use the code button on the MATLAB Answers toolbar to format it nicely.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by