Problem 54485. Dog Statistics
The vectors ht and wt contains the heights and weights of 20 golden retrievers. In some cases, it was not possible to make both measurements, so any empty cells are represented by NaN (Not a Number).
Write a function that calculates the average weight of all golden retrievers within a certain height range. Your function should take the lower and upper bound for the height range as inputs. It should output the average weight of the dogs in that height range, as well as the percentage of dogs in that range.
Solution Stats
Problem Comments
-
1 Comment
Ayush
on 20 Mar 2025
very good
Solution Comments
Show commentsProblem Recent Solvers395
Suggested Problems
-
Calculate the Levenshtein distance between two strings
1506 Solvers
-
1432 Solvers
-
Project Euler: Problem 8, Find largest product in a large string of numbers
1300 Solvers
-
Construct an index vector from two input vectors in vectorized fashion
445 Solvers
-
1923 Solvers
More from this Author12
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!