Cody

# Problem 688. Convert a structure into a string

Solution 2129761

Submitted on 15 Feb 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
s.age = '33' s.prenom ='aurélien' str_correct = ['33',10,'aurélien']; assert(isequal(your_fcn_name(s),str_correct))

s = struct with fields: age: '33' s = struct with fields: age: '33' prenom: 'aurélien'

Undefined function 'your_fcn_name' for input arguments of type 'struct'. Error in Test1 (line 4) assert(isequal(your_fcn_name(s),str_correct))

2   Fail
s.f1 = 'Sunday'; s.f2 = 'Monday'; s.f3 = 'Tuesday'; s.f4 = 'Wednesday'; s.f5 = 'Thursday'; s.f6 = 'Friday'; s.f7 = 'Saturday'; str_correct = ['Sunday',10,'Monday',10,'Tuesday',10,'Wednesday',10,'Thursday',10,'Friday',10,'Saturday']; assert(isequal(your_fcn_name(s),str_correct))

Undefined function 'your_fcn_name' for input arguments of type 'struct'. Error in Test2 (line 9) assert(isequal(your_fcn_name(s),str_correct))

3   Fail
s.age = '42'; s.height = '73.5'; s.weight = '173'; str_correct = ['42',10,'73.5',10,'173']; assert(isequal(your_fcn_name(s),str_correct))

Undefined function 'your_fcn_name' for input arguments of type 'struct'. Error in Test3 (line 5) assert(isequal(your_fcn_name(s),str_correct))

4   Fail
s.hair = 'brown'; s.eye = 'green'; s.fav = 'gold'; str_correct = ['brown',10,'green',10,'gold']; assert(isequal(your_fcn_name(s),str_correct))

Undefined function 'your_fcn_name' for input arguments of type 'struct'. Error in Test4 (line 5) assert(isequal(your_fcn_name(s),str_correct))

5   Fail
s.first = 'Tom'; s.second = 'Jeff'; s.third = 'Bill'; s.fourth = 'Jerry'; s.fifth = 'Harold'; str_correct = ['Tom',10,'Jeff',10,'Bill',10,'Jerry',10,'Harold']; assert(isequal(your_fcn_name(s),str_correct))

Undefined function 'your_fcn_name' for input arguments of type 'struct'. Error in Test5 (line 7) assert(isequal(your_fcn_name(s),str_correct))