This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
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.7272
0.0355
0.6618
0.1908
0.5511
0.1618
0.1953
0.4485
0.0491
0.4566
0.6557
0.7107
0.5888
0.1862
0.8257
0.7072
0.9087
0.5637
0.7148
0.6326
0.1196
0.8746
0.8216
0.7620
0.7802
0.0634
0.2113
0.8449
0.8554
0.4486
0.8948
0.0233
0.9857
0.9635
0.6914
0.5974
0.8085
0.0634
0.3465
0.9533
0.2509
0.1299
0.0629
0.7459
0.9640
0.7616
0.9228
0.3811
0.8328
0.6170
0.1779
0.8445
0.3598
0.6968
0.1141
0.4711
0.1801
0.4024
0.9676
0.9260
0.2724
0.5568
0.0905
0.1272
|
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');
|
3968 Solvers
965 Solvers
260 Solvers
257 Solvers
326 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!