Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: importing mat format doesn't import variable names

  • To: mathgroup at
  • Subject: [mg53511] Re: importing mat format doesn't import variable names
  • From: Ben Barrowes <barrowes at>
  • Date: Sat, 15 Jan 2005 01:44:10 -0500 (EST)
  • References: <> <cs8kid$ejl$>
  • Sender: owner-wri-mathgroup at

It seems that Import extracts only numerical data and loses the variable 
names from MAT files.

OK, how about an Export problem?

Let's say I have two arrays:

How can I save both of these to a MAT file?

I can save either one, e.g.:

But if I try to:

The resulting file size is 0 and the Import consequently fails.

Any way to export more than one matrix to a MAT file?

What I would really like to do is save all the currently defined 
variables to a MAT file. I tried:


But that fails in the same way as the preceeding example when there is 
more than one variable defined.

Tomas Garza wrote:
> Could you give us a small example of the file you're trying to import 
> (perhaps 3 x 3), including the variable names?
> Tomas Garza
> Mexico City
> ----- Original Message ----- 
> From: "Ben Barrowes" <barrowes at>
To: mathgroup at
> Subject: [mg53511]  importing mat format doesn't import variable names
>>This is a very responsive ng. Thanks!
>>When I Import["file","MAT"] files, the variable name information is
>>lost. Is this the normal behavior? Or is there a switch I can specify to
>>import the variable names as well?
>>For example, if file.mat has two variables, foo (3x3) and bar (3x3), and
>>I Import it, all I get is 1 nested List for a result.
>>However, they are simply numbers with no names associated with the list.
>>I know I could do:
>>but I was wondering if there was a way to Import variable names without
>>specifying them explicitly. The information is in the .mat file. Why
>>doesn't Mathematica extract it?
>>Similarly, when I Export a matrix into a mat file, will the variable
>>name be lost?
>>Ben Barrowes

  • Prev by Date: Re: Looking for Window Version of "Factorization.m" program
  • Next by Date: Re: easy question about random numbers
  • Previous by thread: Re: importing mat format doesn't import variable names
  • Next by thread: Re: Re: importing mat format doesn't import variable names