MATLAB - Cell Arrays and Structures
Identify the error in the following MATLAB code snippet:
fname = 'score'; S.fname = 100; disp(S.score);
fname = 'score'; S.fname = 100; disp(S.score);
S.fname = 100; which creates a field literally named 'fname', not 'score'.disp(S.score); tries to display field 'score' which does not exist, causing an error.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions