Tim,
Can you explain what the +'01'-'0' is doing? I don't see how i+'01'-'0'=[i,i+1].
Thanks
'01 ' is a char vector of 2 positions: '0' ans '1'.
If you subtract '0' to it, it results a char vector with characters 0 and 1.
So '01'-'0' is the same as [0 1], but because of the '[]', it cost less operations.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = 1001;
y_correct = [881 883];
assert(isequal(your_fcn_name(x),y_correct))
|
2 | Pass |
%%
x = 1964;
y_correct = [1949 1951];
assert(isequal(your_fcn_name(x),y_correct))
|
3 | Pass |
%%
x = 123456789;
y_correct = [123456209 123456211];
assert(isequal(your_fcn_name(x),y_correct))
|
Remove all the words that end with "ain"
1292 Solvers
831 Solvers
Convert a numerical matrix into a cell array of strings
454 Solvers
Create matrix of replicated elements
321 Solvers
413 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!