Problem 42397. Megan's walk

Solution 1744808

Submitted on 7 Mar 2019
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
% prepares SetSolutionScore urlwrite(';d=1','SetSolutionScore.p'); rehash path; SetSolutionScore(5000); % download Megan model unzip(''); !/bin/mv Megan/* .; /bin/rmdir Megan % gets x1 x2 vectors [x1, x2]=MeganWalk(); assert(isequal(size(x1),[20 1])&isequal(size(x2),[20 1]),'incorrect output sizes'); assert(max(max(abs(x1)),max(abs(x2)))<=2,'vector values beyond 2'); % tests trajectory t = 0:1/20:4-1/20; x = x1*sin(2*pi*t) + x2*cos(2*pi*t); mg=drawMegan(x,[],... 'scene','none',... 'defs_physicsspin',0,... 'plot',0); close all; % distance walked pos=mg.state.laststep(1:2); distance=round(-pos(1,2)-abs(pos(1,1))); str=sprintf('Distance walked %d',distance); disp(str); % sets solution score SetSolutionScore(5000-distance); assert(distance>100,str);

Error using unzip (line 84) Invalid zip file "/tmp/tpb2bef103_36a4_477d_ba5f_81aeeef7e661". Error in Test1 (line 7) unzip('');

Suggested Problems

More from this Author38

Community Treasure Hunt

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

Start Hunting!