Skip to content

Instantly share code, notes, and snippets.

@myw
Created October 31, 2011 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myw/1329224 to your computer and use it in GitHub Desktop.
Save myw/1329224 to your computer and use it in GitHub Desktop.
Matlab struct examples
>> j = struct()
j =
1x1 struct array with no fields.
>> j(2).b = 4
j =
1x2 struct array with fields:
b
>> j(3).b = 'FOO';
>> j(4).blarg = 'hottitotti';
>> j
j =
1x4 struct array with fields:
b
blarg
>> jb = {j.b}
jb =
[] [4] 'FOO' []
>> jblarg = {j.blarg}
jblarg =
[] [] [] 'hottitotti'
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment