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: setting multiple structure values
Replies: 4   Last Post: Mar 1, 2014 4:20 PM

Advanced Search

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

Posts: 30
Registered: 4/14/09
Re: setting multiple structure values
Posted: May 31, 2012 9:07 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <jq7lgo$sua$1@newscl01ah.mathworks.com>...
> "Oliver" wrote in message <jq78tg$as2$1@newscl01ah.mathworks.com>...
> > Hi all,
> >
> > This is probably an easy question but I can't figure it out :(
> >
> > I'm currently doing this...
> > for n=1:length(PlotRecords)
> > PlotRecords(n).PlotLatitude = CorrectedLat(n);
> > PlotRecords(n).PlotLongitude = CorrectedLon(n);
> > end
> >

>
> This should work
>
> c = num2cell(CorrectedLat);
> [PlotRecords.PlotLatitude] = deal(c{:});
>
> % Bruno


ah that's perfect, cheers mate!



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.