MATLAB - Cell Arrays and Structures
What will be the output of this MATLAB code?
fields = {'a', 'b', 'c'};
for k = 1:3
S.(fields{k}) = k*10;
end
disp(S.b);fields = {'a', 'b', 'c'};
for k = 1:3
S.(fields{k}) = k*10;
end
disp(S.b);15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions