Cody

Solution 1317461

Submitted on 27 Oct 2017
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
N={'Mercury','Venus','Earth','Mars','Jupiter',... 'Saturn','Uranus','Neptune','Pluto'}; P=[0.5000 1.9246 365.2425 668.5950 10471.0182 ... 24204.8198 42582.9327 89087.3743 14183.7398]; for i=1:9 p=P(i); m=leapsequence(p); n=numel(m); r=dot(1./m,(-1).^(0:n-1)); disp([N{i} ' p=' num2str(p,'%0.6f') ... ' r=' num2str(r,'%0.6f') ' m=' mat2str(m)]) assert(abs(floor(p)+r-p)<=0.00005); assert(all(m>0)) assert(all(mod(m,1)==0)) assert(all(mod([m 0],[1 m])==0)) end

Error using dot (line 33) A and B must be same size. Error in Test1 (line 9) r=dot(1./m,(-1).^(0:n-1));

Suggested Problems

More from this Author10