Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: struct literal?
Replies: 2   Last Post: Sep 4, 2012 11:38 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Andreas Lobinger

Posts: 12
Registered: 7/29/11
struct literal?
Posted: Sep 4, 2012 11:02 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Aloha,

this is tricky. Maybe i'm missing some basics?

I want to put the following into a one-liner.
>> d = struct('freq',[1 1],'RAT',[1 2]);
>> d.name = {'a-string','b-string'};
>> d


d =

freq: [1 1]
RAT: [1 2]
name: {'a-string' 'b-string'}

so i continue in the struct literal with ...

>> d = struct('freq',[1 1],'RAT',[1 2],'name',{'a-string','b-string'})

d =

1x2 struct array with fields:
freq
RAT
name

Any good ideas?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.