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: help
Replies: 1   Last Post: Feb 21, 2013 8:57 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  

Posts: 9,850
Registered: 6/7/07
Re: help
Posted: Feb 21, 2013 8:57 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 2/21/2013 4:45 AM, Kanishka wrote:
> I have a 612x15x15 matrix with 612 months temprature 15 lattitudes and
> 15 longitudes. I want to save the 612 months temp for each latt,long
> (i.e (1,1) (1,2)..,(2,1)(2,2)... (15,15)) into a new variable.

That's probably not a real good way to progress in Matlab -- that'll
leave you w/ 225 separate variables, not an easy thing to generalize w/
explicit variable names. If you create sequential names in the
workspace ("Poof" variables in common parlance), it takes eval() to
process them which syntax is both error prone and slow.

Better is likely to either make named fields in a sturcture or use cell
arrays where a cell holds the desired conditions for a location or
simply just use the indices directly. Read the doc section on "Why
Avoid the Eval Function" for more details...

If that really doesn't satisfy, provide more specifics on how you want
to process these data and why you think you need separate variables to
begin with.


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.