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 ]
Steven Lord

Posts: 18,038
Registered: 12/7/04
Re: trouble saving data structure to a file
Posted: Nov 6, 2012 10:20 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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


> 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

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.