Problem 897. Finite Continued Fraction

Given an input real number x and a natural number n, output the row vector with the n first terms of the continued fraction. For more details, you could find help here:


Inputs: x=pi; n = 10;

Output: y = [3 7 15 1 292 1 1 1 2 1];

Solution Stats

42.0% Correct | 58.0% Incorrect
Last solution submitted on Sep 21, 2016

Problem Comments


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more