Cody

Solution 1874612

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

ans = 0.6624 0.0216 0.4886 0.5743 0.4094 0.4006 0.5417 0.4250 0.4780 0.2877 0.6355 0.5522 0.7353 0.2847 0.2812 0.2937 0.8677 0.7836 0.3988 0.2960 0.8333 0.8292 0.1959 0.1690 0.9346 0.3185 0.2812 0.6555 0.1253 0.4306 0.7107 0.3685 0.9338 0.9209 0.4553 0.0805 0.0518 0.6588 0.1122 0.1028 0.8298 0.5339 0.8695 0.2907 0.5961 0.2977 0.3411 0.1591 0.5158 0.4450 0.2584 0.0767 0.6178 0.4037 0.2468 0.9543 0.1742 0.8249 0.8080

2   Fail
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');

Only change the lines you are asked to

Suggested Problems

More from this Author1