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.8112
0.0193
0.0839
0.9748
0.6513
0.2312
0.4035
0.1220
0.2684
0.2578
0.3317
0.1522
0.3480
0.1217
0.8842
0.0943
0.9300
0.3990
0.0474
0.3424
0.7360
0.7947
0.5449
0.6862
0.8936
0.0548
0.3037
0.0462
0.1955
0.7202
0.7218
0.8778
0.5824
0.0707
0.9227
0.8004
0.2859
0.5437
0.9848
0.7157
0.8390
0.4333
0.4706
0.5607
0.2691
0.7490
0.5039
0.6468
0.3077
0.1387
0.4756
0.3625
0.7881
0.7803
0.6685
0.1335
0.0216
0.5598
0.3008
0.9394
0.9809
0.2866
0.8008
|
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');
|
Getting the row and column location from a matrix
236 Solvers
521 Solvers
Count decimal digits of a number
176 Solvers
Is this triangle right-angled?
2875 Solvers
465 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!