Problem 1072. Television Screen Dimensions
Given a width to height ratio of a TV screen given as w and h as well as the diagonal length of the television l, return the actual width and height of the screen to one decimal point of precision.
Example:
w = 16; h = 9; l = 42; [W,H] = teledims(w,h,l);
outputs
W = 36.6 H = 20.6
Solution Stats
Problem Comments
-
4 Comments
Thanks James, I've fixed it now.
I also used round, but I not seen to be the best solution.
36.6/20.6==16/9 is false.
The values from the test suite are also inaccurate.
Solution Comments
Show commentsProblem Recent Solvers546
Suggested Problems
-
Convert a vector into a number
604 Solvers
-
Set the array elements whose value is 13 to 0
1385 Solvers
-
Who has power to do everything in this world?
459 Solvers
-
Try 1.5.4: Celsius to Fahrenheit
840 Solvers
-
String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values
1782 Solvers
More from this Author56
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!