MATLAB - Cell Arrays and Structures
What will be the output of the following MATLAB code?
field = 'age'; S.(field) = 25; disp(S.age);
field = 'age'; S.(field) = 25; disp(S.age);
field holds 'age'. Using S.(field) = 25; creates field 'age' with value 25 in structure S.disp(S.age); prints the value of field 'age', which is 25.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions