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 88714

Submitted on 14 May 2012 by Brett Shoelson

Correct

32Size
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
str =
33
aurélien
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
str =
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday