The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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


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]);
>> = {'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:

Any good ideas?

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.