Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = [1 2; 3 4]; x1 = [4 3; 2 1];
y_correct = 5*ones(2);
assert(isequal(your_fcn_name(x, x1),y_correct))
ans =
5 5
5 5
|
2 | Pass |
x = ones(3,5); x1 = x;
y_correct = 2*x;
assert(isequal(your_fcn_name(x, x1),y_correct))
ans =
2 2 2 2 2
2 2 2 2 2
2 2 2 2 2
|
3 | Pass |
x = 1:10; x1 = 10:-1:1;
y_correct = 11*ones(1,10);
assert(isequal(your_fcn_name(x, x1),y_correct))
ans =
11 11 11 11 11 11 11 11 11 11
|
4 | Pass |
x = magic(3); x1 = flipud(fliplr(x));
y_correct = 10*ones(3);
assert(isequal(your_fcn_name(x, x1),y_correct))
ans =
10 10 10
10 10 10
10 10 10
|
5 | Pass |
x = [1 5 7 9]; x1 = [3 -5 6 15];
y_correct = [4 0 13 24];
assert(isequal(your_fcn_name(x, x1),y_correct))
ans =
4 0 13 24
|
6 | Pass |
x = eye(4); x1 = fliplr(x);
y_correct = [1,0,0,1;0,1,1,0;0,1,1,0;1,0,0,1];
assert(isequal(your_fcn_name(x, x1),y_correct))
ans =
1 0 0 1
0 1 1 0
0 1 1 0
1 0 0 1
|
Find all elements less than 0 or greater than 10 and replace them with NaN
13051 Solvers
Extract leading non-zero digit
1205 Solvers
2983 Solvers
Find the dimensions of a matrix
372 Solvers
Append two matrix as shown below example
181 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!