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 | Pass |
x = [1 2 3 4 5];
c = 'uint32';
y_correct = 'uint32';
assert(strcmp(class(convertto(x,c)),y_correct) && isequal(x,convertto(x,c)))
y =
1×5 uint32 row vector
1 2 3 4 5
y =
1×5 uint32 row vector
1 2 3 4 5
|
2 | Pass |
x = [4 7 0 3 2 2];
c = 'int16';
y_correct = 'int16';
assert(strcmp(class(convertto(x,c)),y_correct) && isequal(x,convertto(x,c)))
y =
1×6 int16 row vector
4 7 0 3 2 2
y =
1×6 int16 row vector
4 7 0 3 2 2
|
1399 Solvers
Sum all integers from 1 to 2^n
6311 Solvers
Back to basics 23 - Triangular matrix
532 Solvers
Remove white space from the string
143 Solvers
Sum the numbers on the main diagonal
375 Solvers