Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
a = magic(4);
y=[16 2 3 13 10 7 4 14 15 1];
assert(isequal(z_mat(a),y))
out1 =
16 2 3 13 10 7 4 14 15 1
|
2 | Pass |
a = ones(77);
y=ones(1,229);
assert(isequal(z_mat(a),y))
out1 =
Columns 1 through 30
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Columns 31 through 60
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Columns 61 through 90
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Columns 91 through 120
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Columns 121 through 150
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Columns 151 through 180
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Columns 181 through 210
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Columns 211 through 229
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
3 | Pass |
a = eye(7);
y=[1,zeros(1,8),1,zeros(1,8),1];
assert(isequal(z_mat(a),y))
out1 =
1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1
|
4 | Pass |
a=[32 1 3 3;3 3 3 3;56 3 54 344;0 654 2 1];
y=[32 1 3 3 3 3 0 654 2 1];
assert(isequal(z_mat(a),y))
out1 =
32 1 3 3 3 3 0 654 2 1
|
5 | Pass |
a = [101 101;101 101];
assert(isequal(z_mat(a),a(:)'))
out1 =
101 101 101 101
|
Select every other element of a vector
20331 Solvers
2313 Solvers
219 Solvers
Create sequnce 1 4 9 16 25.........
190 Solvers
299 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!