Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 164240

Submitted on 19 Nov 2012

Incorrect

51Size
Leading solution size is 81.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Fail
 
%%
l = 5;
s = '#=~-';
y_correct = strvcat({
   '#=~--'
   '=#---'
   '~=#--'
   '-~=#-'
   '--~=#'
   '---#='
   '--#=~'
   '-#=~-'
   '#=~--'
});
assert(isequal(kitt(l,s),y_correct))
Error: The ''pause'' command is not supported on this platform using these arguments: ''n > 2''
2
Fail
 
%%
l = 2;
s = '*';
y_correct = strvcat({
   '**'
   '**'
});
assert(isequal(kitt(l,s),y_correct))
Error: The ''pause'' command is not supported on this platform using these arguments: ''n > 2''
3
Fail
 
%%
l = 5;
s = '@ ';
y_correct = strvcat({
   '@    '
   ' @   '
   '  @  '
   '   @ '
   '    @'
   '   @ '
   '  @  '
   ' @   '
   '@    '
});
assert(isequal(kitt(l,s),y_correct))
Error: The ''pause'' command is not supported on this platform using these arguments: ''n > 2''
4
Fail
 
%%
l = 6;
s = '@>>*=~ ';
y_correct = strvcat({
   '@>>*=~'
   '>@*=~ '
   '>>@~  '
   '*>>@  '
   '=*>>@ '
   '~=*>>@'
   ' ~=*@>'
   '  ~@>>'
   '  @>>*'
   ' @>>*='
   '@>>*=~'
});
assert(isequal(kitt(l,s),y_correct))
Error: The ''pause'' command is not supported on this platform using these arguments: ''n > 2''