Computing all values for Width and Height

1 Ansicht (letzte 30 Tage)
joe brady
joe brady am 12 Mär. 2020
Kommentiert: Jon am 13 Mär. 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.

Antworten (1)

Jon
Jon am 12 Mär. 2020
Bearbeitet: Jon am 12 Mär. 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 Kommentare
joe brady
joe brady am 12 Mär. 2020
Great thank you.
Jon
Jon am 13 Mär. 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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by