Cody

Solution 409680

Submitted on 25 Feb 2014 by J-G van der Toorn
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.0597 0.6580 0.8896 0.1096 0.4378 0.2802 0.9852 0.6088 0.2537 0.1326 0.5450 0.8278 0.8370 0.8333 0.2037 0.5444 0.8749 0.1210 0.8564 0.8998 0.2179 0.0770 0.4742 0.8350 0.4694 0.4138 0.5027 0.1254 0.1323 0.8705 0.6030 0.2653 0.8648 0.0581 0.4578 0.7222 0.3390 0.4012 0.5270 0.8942 0.7784 0.0694 0.2788 0.3794 0.8647 0.4200 0.2399 0.5977 0.4794 0.8985 0.9347 0.8179 0.7089 0.7432 0.8997
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');