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

76.92% Correct | 23.08% Incorrect
Last Solution submitted on Nov 10, 2025

Solution Comments

Show comments

Problem Recent Solvers39

Suggested Problems

More from this Author22

Community Treasure Hunt

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

Start Hunting!