Cody

Problem 44088. '5*3' copy character 3 - five times

Solution 3058468

Submitted on 4 Oct 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
x = '5*3'; y_correct = '33333'; assert(isequal(repchar(x),y_correct))

x = '5*33333'

Output argument "y" (and maybe others) not assigned during call to "repchar". Error in Test1 (line 3) assert(isequal(repchar(x),y_correct))

2   Fail
x = '7*a'; y_correct = 'aaaaaaa'; assert(isequal(repchar(x),y_correct))

x = '7*aaaaaaa'

Output argument "y" (and maybe others) not assigned during call to "repchar". Error in Test2 (line 3) assert(isequal(repchar(x),y_correct))

3   Fail
x = '1*4'; y_correct = '4'; assert(isequal(repchar(x),y_correct))

x = '1*4'

Output argument "y" (and maybe others) not assigned during call to "repchar". Error in Test3 (line 3) assert(isequal(repchar(x),y_correct))

4   Fail
x = '-HGuad157455*337891u5'; y_correct = '-HGuad157453333337891u5'; assert(isequal(repchar(x),y_correct))

x = '-HGuad157455*33333333337891u5'

Output argument "y" (and maybe others) not assigned during call to "repchar". Error in Test4 (line 3) assert(isequal(repchar(x),y_correct))

5   Fail
x = '[11]*9'; y_correct = '99999999999'; assert(isequal(repchar(x),y_correct))

x = '[11]*9'

Output argument "y" (and maybe others) not assigned during call to "repchar". Error in Test5 (line 3) assert(isequal(repchar(x),y_correct))

6   Fail
x = 'abcA;IK4598716[11]*9iobofd89156'; y_correct = 'abcA;IK459871699999999999iobofd89156'; assert(isequal(repchar(x),y_correct))

x = 'abcA;IK4598716[11]*9iobofd89156'

Output argument "y" (and maybe others) not assigned during call to "repchar". Error in Test6 (line 3) assert(isequal(repchar(x),y_correct))

7   Fail
x = '5*34*7'; y_correct = '333337777'; assert(isequal(repchar(x),y_correct))

x = '5*333334*7'

Output argument "y" (and maybe others) not assigned during call to "repchar". Error in Test7 (line 3) assert(isequal(repchar(x),y_correct))

8   Fail
x = '-abc5*3abc4*7abc-'; y_correct = '-abc33333abc7777abc-'; assert(isequal(repchar(x),y_correct))

x = '-abc5*33333abc4*7abc-'

Output argument "y" (and maybe others) not assigned during call to "repchar". Error in Test8 (line 3) assert(isequal(repchar(x),y_correct))

9   Fail
x = ']1478151*38791561-3*487945612['; y_correct = ']14781538791561-44487945612['; assert(isequal(repchar(x),y_correct))

x = ']1478151*38791561-3*487945612['

Output argument "y" (and maybe others) not assigned during call to "repchar". Error in Test9 (line 3) assert(isequal(repchar(x),y_correct))

10   Fail
x = '5*34*75*5'; y_correct = '33333777755555'; assert(isequal(repchar(x),y_correct))

x = '5*333334*75*5'

Output argument "y" (and maybe others) not assigned during call to "repchar". Error in Test10 (line 3) assert(isequal(repchar(x),y_correct))

11   Fail
x = '5*34*7[10]*5'; y_correct = '3333377775555555555'; assert(isequal(repchar(x),y_correct))

x = '5*333334*7[10]*5'

Output argument "y" (and maybe others) not assigned during call to "repchar". Error in Test11 (line 3) assert(isequal(repchar(x),y_correct))

12   Fail
x = '[bdD8-472*3565b1fd4*7rejyyng599811f[10]*5-5116fd1b]'; y_correct = '[bdD8-4733565b1fd7777rejyyng599811f5555555555-5116fd1b]'; assert(isequal(repchar(x),y_correct))

x = '[bdD8-472*33565b1fd4*7rejyyng599811f[10]*5-5116fd1b]'

Output argument "y" (and maybe others) not assigned during call to "repchar". Error in Test12 (line 3) assert(isequal(repchar(x),y_correct))

13   Fail
x = '[]-156fd1s56bf156ds'; y_correct = '[]-156fd1s56bf156ds'; assert(isequal(repchar(x),y_correct))

Unrecognized function or variable 's2'. Error in repchar (line 16) tt=repmat(s2,[1 str2num(s1)]); Error in Test13 (line 3) assert(isequal(repchar(x),y_correct))

Suggested Problems

More from this Author67

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!