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 | Fail |
for a = 1:30
ndms = ceil(rand(1) * 5) + 1
sz = 1 + ceil(rand(1, ndms) * 10);
A = rand(sz);
sz1 = sz(1);
sz(1) = 1;
I = ceil(rand(sz) * sz1);
B = reshape(A(I(:)+(0:sz1:numel(A)-1)'), size(I));
p = randperm(ndms);
A = permute(A, p);
I = permute(I, p);
B = permute(B, p);
assert(isequal(dimsel(A, I), B));
end
ndms =
6
a =
10
B =
0.5730
B =
0.5730 0.3678
B =
0.5730 0.3678 0.3370
B =
0.5730 0.3678 0.3370 0.9758
|
4107 Solvers
Determine if a Given Number is a Triangle Number
322 Solvers
Sum all integers from 1 to 2^n
8418 Solvers
132 Solvers
60 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!