Cody

Solution 285587

Submitted on 19 Jul 2013 by Chad Gilbert
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   Pass
%% n = ceil(100*rand()); v = rand(1,n); v_correct = v'; assert(isequal(question(v),v_correct));

myAns = 0.4868 0.4359 0.4468 0.3063 0.5085 0.5108 0.8176 0.7948 0.6443 0.3786 0.8116 0.5328 0.3507 0.9390 0.8759 0.5502 0.6225 0.5870 0.2077 0.3012 0.4709 0.2305 0.8443 0.1948 0.2259 0.1707 0.2277 0.4357 0.3111 0.9234 0.4302 0.1848 0.9049 0.9797 0.4389 0.1111 0.2581 0.4087 0.5949 0.2622 0.6028 0.7112 0.2217 0.1174 0.2967 0.3188 0.4242 0.5079 0.0855 0.2625 0.8010 0.0292 0.9289 0.7303 0.4886 0.5785 0.2373 0.4588 0.9631 0.5468 0.5211 0.2316 0.4889 0.6241 0.6791 0.3955 0.3674 0.9880 0.0377 0.8852 0.9133 0.7962 0.0987 0.2619 0.3354 0.6797 0.1366 0.7212

2   Pass
%% fid = fopen('question.m'); line1=fgetl(fid); line2=fgetl(fid); line3=fgetl(fid); fclose(fid); assert(strcmp('function myAns = question(v)',line1),'Only change the lines you are asked to'); assert(strcmp(' %%%%%',line2),'Only change the lines you are asked to'); assert(strcmp(' %%%%% Place your code below. DO NOT change anything outside the region %%%%',line3),'Only change the lines you are asked to');

Suggested Problems

More from this Author1