15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SciPy Reference Guide, Release 0.8.dev<br />

Notes<br />

Whether to load matlab structs as numpy record arrays, or as old-style numpy arrays<br />

with dtype=object. Setting this flag to False replicates the behaviour of <strong>scipy</strong> version<br />

0.6 (returning numpy object arrays). The preferred setting is True, because it allows<br />

easier round-trip load and save of matlab files. In a future version of <strong>scipy</strong>, we<br />

will change the default setting to True, and following versions may remove this flag<br />

entirely. For now, we set the default to False, for backwards compatibility, but issue<br />

a warning.<br />

Returns<br />

mat_dict : dict<br />

dictionary with variable names as keys, and loaded matrices as values<br />

v4 (Level 1.0), v6 and v7 to 7.2 matfiles are supported.<br />

You will need an HDF5 python library to read matlab 7.3 format mat files. Because <strong>scipy</strong> does not supply one,<br />

we do not implement the HDF5 / 7.3 interface here.<br />

savemat(file_name, mdict, appendmat=True, format=’5’, long_field_names=False, do_compression=False,<br />

oned_as=None)<br />

Save a dictionary of names and arrays into the MATLAB-style .mat file.<br />

This saves the arrayobjects in the given dictionary to a matlab style .mat file.<br />

Parameters<br />

file_name : {string, file-like object}<br />

Name of the mat file (do not need .mat extension if appendmat==True) Can also pass<br />

open file-like object<br />

m_dict : dict<br />

dictionary from which to save matfile variables<br />

appendmat : {True, False} optional<br />

True to append the .mat extension to the end of the given filename, if not already<br />

present<br />

format : {‘5’, ‘4’} string, optional<br />

‘5’ for matlab 5 (up to matlab 7.2) ‘4’ for matlab 4 mat files<br />

long_field_names : boolean, optional, default=False<br />

• False - maximum field name length in a structure is 31 characters which is the documented<br />

maximum length<br />

• True - maximum field name length in a structure is 63 characters which works for Matlab<br />

7.6<br />

do_compression : {False, True} bool, optional<br />

Whether to compress matrices on write. Default is False<br />

oned_as : {‘column’, ‘row’} string, optional<br />

If ‘column’, write 1D numpy arrays as column vectors If ‘row’, write 1D numpy<br />

arrays as row vectors<br />

212 Chapter 3. Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!