Computing all values for Width and Height

1 view (last 30 days)
joe brady
joe brady on 12 Mar 2020
Commented: Jon on 13 Mar 2020
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.

Answers (1)

Jon
Jon on 12 Mar 2020
Edited: Jon on 12 Mar 2020
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 Comments
Jon
Jon on 13 Mar 2020
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.

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!