Problem 61036. The MATLAB Treasure Hunt – Cross the River of Ratios by Finding Successive Proportions in the Data Stream
Following the glowing script, you arrive at the River of Ratios — a flowing stream of numbers.
A carved message on the rocks reads: “Only those who know the balance between every pair shall cross.”
Given a numeric vector a, calculate the ratio of each element to the previous one.
Return a vector r such that r(i) = a(i+1)/a(i) for all valid i.
This will reveal the rhythm of the river and guide your next step!
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers7
Suggested Problems
More from this Author22
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!