change the value of a data structure field

 Accepted Answer

s(3).Val='1';
s.Val
ans = [] ans = []
ans = '1'
[s.Val]=deal('2')
s = 1x3 struct array with fields:
Val
s.Val
ans = '2'
ans = '2'
ans = '2'

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!