Computing all values for Width and Height

1 visualización (últimos 30 días)
joe brady
joe brady el 12 de Mzo. de 2020
Comentada: Jon el 13 de Mzo. de 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.

Respuestas (1)

Jon
Jon el 12 de Mzo. de 2020
Editada: Jon el 12 de Mzo. de 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 comentarios
joe brady
joe brady el 12 de Mzo. de 2020
Great thank you.
Jon
Jon el 13 de Mzo. de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by