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

Learn moreOpportunities for recent engineering grads.

Apply TodayGiven row vector

c=[c0 c1 c2 c3 ...]

evaluate the continued fraction

x=c0+1/(c1+1/(c2+1/(c3+...)))

If c is a matrix, return column vector x in which x(i) is the solution for row i of c.

24 correct solutions
25 incorrect solutions

Last solution submitted on Apr 24, 2016

1 Comment

J.R.! Menzinger
on 26 Feb 2013

not a bad idea but...
try this:
function ans = contfrac(c)
%%
c(:,1);
if size(c,2)>1
ans + 1./contfrac(c(:,2:end));
end

1 Comment

choi
on 7 Nov 2013

how can i see this??

1 Comment