Cody

Solution 1982567

Submitted on 19 Oct 2019 at 11:22
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   Pass
assessFunctionAbsence('regexp','FileName','fullname.m')

2   Fail
firstnames = string({'Donald';'Hillary'}); lastnames = string({'Trump';'Clinton'}); y_correct = string({'Donald Trump';'Hillary Clinton'}); assert(isequal(fullname(firstnames,lastnames),y_correct))

y = "Donald Trump" y = 1×2 string array "Donald Trump" "Hillary Clinton" ans = 2 ans = 2 m1 = 2 1 m2 = 2 1

Assertion failed.

3   Pass
firstnames = string({'Bill','Hillary'}); lastnames = string('Clinton'); y_correct = string({'Bill Clinton','Hillary Clinton'}); assert(isequal(fullname(firstnames,lastnames),y_correct))

lastnames = 1×2 string array "Clinton" "Clinton" y = "Bill Clinton" y = 1×2 string array "Bill Clinton" "Hillary Clinton" ans = 2 ans = 2 m1 = 1 2 m2 = 1 2

4   Fail
firstnames = string({'Donald';'Barron';'Eric'}); lastnames = string('Trump'); y_correct = string({'Donald Trump';'Barron Trump';'Eric Trump'}); assert(isequal(fullname(firstnames,lastnames),y_correct))

lastnames = 1×2 string array "Trump" "Trump" lastnames = 1×3 string array "Trump" "Trump" "Trump" y = "Donald Trump" y = 1×2 string array "Donald Trump" "Barron Trump" y = 1×3 string array "Donald Trump" "Barron Trump" "Eric Trump" ans = 3 ans = 3 m1 = 3 1 m2 = 1 3

Assertion failed.

5   Fail
firstnames = string('Mike'); lastnames = string({'Tyson','Pence','Trout'}); y_correct = string({'Mike Tyson','Mike Pence','Mike Trout'}); assert(isequal(fullname(firstnames,lastnames),y_correct))

y = "Mike Tyson" ans = 1 ans = 3 m1 = 1 1 m2 = 1 3

Assertion failed.

6   Fail
firstnames = string({'Donald','Hillary';'Mike','James'}); lastnames = string({'Trump','Clinton';'Pence','Bond'}); y_correct = string({'Donald Trump','Hillary Clinton';'Mike Pence','James Bond'}); assert(isequal(fullname(firstnames,lastnames),y_correct))

y = "Donald Trump" y = 1×2 string array "Donald Trump" "Mike Pence" y = 1×3 string array "Donald Trump" "Mike Pence" "Hillary Clinton" y = 1×4 string array "Donald Trump" "Mike Pence" "Hillary Clinton" "James Bond" ans = 4 ans = 4 m1 = 2 2 m2 = 2 2

Assertion failed.