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 =
3
a =
11
B =
0.4503
B =
0.4503 0.6474
B =
0.4503 0.6474 0.1884
B =
0.4503 0.6474 0.1884 0.5082
B =
0.4503 0.6474 0.1884 0.5082 0.4919
B =
0.4503 0.6474 0.1884 0.5082 0.4919 0.2155
B =
0.4503 0.6474 0.1884 0.5082 0.4919 0.2155 0.2042
B =
0.4503 0.6474 0.1884 0.5082 0.4919 0.2155 0.2042 0.4292
B =
0.4503 0.6474 0.1884 0.5082 0.4919 0.2155 0.2042 0.4292 0.7720
B =
0.4503 0.6474 0.1884 0.5082 0.4919 0.2155 0.2042 0.4292 0.7720 0.5369
B =
0.4503 0.6474 0.1884 0.5082 0.4919 0.2155 0.2042 0.4292 0.7720 0.5369 0.4807
|
Test if a Number is a Palindrome without using any String Operations
181 Solvers
Back to basics 19 - character types
225 Solvers
130 Solvers
52 Solvers
Test if two numbers have the same digits
187 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!