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: trouble saving data structure to a file
Replies: 7   Last Post: Nov 12, 2012 10:21 AM

Advanced Search

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

Posts: 25
Registered: 3/17/11
Re: trouble saving data structure to a file
Posted: Nov 8, 2012 5:35 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Steven_Lord" <> wrote in message <k7b9r0$ahr$>...
> "Ben Ruppel" <> wrote in message
> news:k7b6ao$q01$

> > "Steven_Lord" <> wrote in message
> > <k7a66a$asf$>...

> *snip*

> > Thank you very much, your solution worked. I'm not thrilled with creating
> > a copy of A, B, and C since these are very large variables.

> Depending on what you're doing, you may not be creating an actual copy.
> The copy-on-write behavior may save you from actually making a copy.

> > How can you tell that handles.inputData is not a scalar struct variable?
> Variable names in MATLAB have four specific rules:
> 'handles.inputData' contains a period, which is not allowed in variable
> names. That makes it an expression that when evaluated returns a variable.
> If you assign the output of that expression to an identifier, that
> identifier must be a valid variable name.

> > In Variable Editor both handles and handles.inputData are listed as "1x1
> > struct". Furthermore, they are both data "things" in matlab which contain
> > multiple data structures and arrays and cell arrays. What makes the one
> > different from the other?

> "Ben Ruppel" is the name you use to post to CSSM.
> "The person that posts to CSSM using the address '' " refers
> to you, but it is not your name. If I "evaluate" that expression by
> searching CSSM, I can find your actual name. [Not the best of examples, as
> anyone can spoof their email address, but hopefully good enough for
> illustration purposes.]

> > Is there a way for me to make handles.inputData a scalar struct variable?
> For purposes of SAVE? Not without assigning it to a variable.

> > Or is the problem more that handles.inputData is an expression? If that
> > is the case, is there a way to point to this data structure that does not
> > count as an expression?

> If you're worried about memory, see above.
> --
> Steve Lord
> To contact Technical Support use the Contact Us link on

Hi Steve,
Thank you for the information and the useful links. While I accept it as the truth, I still think it's a little odd and inconsistent that some functions aren't smart enough to figure out when an expression points to a variable. After all, if I were to create my own function, I could pass in a variable name or a data structure member reference / expression and the function would see both as the data that is being referenced. Oh well.

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.