Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
n=2;
m=5;
S=1:10;
y_correct =[1 2
3 4
5 6
7 8
9 10];
assert(isequal(ResHape(S,m,n),y_correct))
y =
1 2
3 4
5 6
7 8
9 10
|
2 | Pass |
n=4;
m=8;
S=[1:10 6:12 5:19]
y_correct=[ 1 2 3 4
5 6 7 8
9 10 6 7
8 9 10 11
12 5 6 7
8 9 10 11
12 13 14 15
16 17 18 19]
assert(isequal(ResHape(S,m,n),y_correct))
S =
Columns 1 through 29
1 2 3 4 5 6 7 8 9 10 6 7 8 9 10 11 12 5 6 7 8 9 10 11 12 13 14 15 16
Columns 30 through 32
17 18 19
y_correct =
1 2 3 4
5 6 7 8
9 10 6 7
8 9 10 11
12 5 6 7
8 9 10 11
12 13 14 15
16 17 18 19
y =
1 2 3 4
5 6 7 8
9 10 6 7
8 9 10 11
12 5 6 7
8 9 10 11
12 13 14 15
16 17 18 19
|
3 | Pass |
n=2;
m=31;
S=[1:10 6:12 zeros(1,20) 5:19 ones(1,10)]
y_correct=[1 2
3 4
5 6
7 8
9 10
6 7
8 9
10 11
12 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 5
6 7
8 9
10 11
12 13
14 15
16 17
18 19
1 1
1 1
1 1
1 1
1 1];
assert(isequal(ResHape(S,m,n),y_correct))
S =
Columns 1 through 29
1 2 3 4 5 6 7 8 9 10 6 7 8 9 10 11 12 0 0 0 0 0 0 0 0 0 0 0 0
Columns 30 through 58
0 0 0 0 0 0 0 0 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 1 1 1 1 1
Columns 59 through 62
1 1 1 1
y =
1 2
3 4
5 6
7 8
9 10
6 7
8 9
10 11
12 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 5
6 7
8 9
10 11
12 13
14 15
16 17
18 19
1 1
1 1
1 1
1 1
1 1
|
19329 Solvers
Calculate the area of a triangle between three points
871 Solvers
Area of an equilateral triangle
2758 Solvers
302 Solvers
Convert given decimal number to binary number.
636 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!