Cody

Solution 531954

Submitted on 21 Nov 2014 by Ciuban Sebastian
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.6167 0.8254 0.3309 0.6606 0.4664 0.5958 0.3351 0.9912 0.5123 0.3540 0.4491 0.8370 0.5108 0.1108 0.7859 0.7522 0.2728 0.8483 0.8709 0.6274 0.7660 0.0707 0.5064 0.2339 0.0749 0.2591 0.9873 0.6618 0.1852 0.6192 0.1040 0.1028 0.0907

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