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
Solution Comments
Show comments
Loading...
Problem Recent Solvers558
Suggested Problems
-
16156 Solvers
-
993 Solvers
-
Find nearest prime number less than input number
1016 Solvers
-
Sum the 'edge' values of a matrix
400 Solvers
-
Find my daddy long leg (No 's')
2723 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!
I think you have your W and H mixed up in your example and test suite.
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.