Cody

Solution 303035

Submitted on 13 Aug 2013 by Suman Saha
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.8101 0.2328 0.3100 0.0422 0.7600 0.6075 0.0930 0.7994 0.7969 0.4779 0.2443 0.7286 0.7231 0.7695 0.9378 0.3852 0.5206 0.8327 0.7255 0.8568 0.6444 0.2077 0.2268 0.2636 0.8157 0.8190 0.1961 0.2938 0.6068 0.6518 0.0430 0.5456 0.6093 0.1514 0.9324 0.0646 0.3835 0.7217 0.5840 0.3277 0.8288 0.7076 0.5247 0.6740 0.8648 0.0690 0.7978

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