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 173808

Submitted on 6 Dec 2012 by J.R.! Menzinger

Correct

37Size
Leading solution size is 14.
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
Pass
 
%% Test the example
s.age = '33'
s.prenom ='aurélien'
str_correct = ['33',10,'aurélien']
assert(isequal(your_fcn_name(s),str_correct))
s =
    age: '33'
s =
       age: '33'
    prenom: 'aurélien'
str_correct =
33
aurélien
ans =
    [1x3 char]
    [1x9 char]
2
Pass
 
%% Another example
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))
str_correct =
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
ans =
    [1x7  char]
    [1x7  char]
    [1x8  char]
    [1x10 char]
    [1x9  char]
    [1x7  char]
    [1x9  char]