Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
24
Добавлен:
09.02.2015
Размер:
407.04 Кб
Скачать

If any data items require features that the specified version does not

support, MATLAB does not save those items and issues a warning. You

cannot specify a version later than your version of MATLAB software.

To view or set the default version for MAT-files, select

File > Preferences > General > MAT-Files.

Examples:

% Save all variables from the workspace to test.mat:

save test.mat

% Save two variables, where FILENAME is a variable:

savefile = 'pqfile.mat';

p = rand(1, 10);

q = ones(10);

save(savefile, 'p', 'q');

% Save the fields of a structure as individual variables:

s1.a = 12.7;

s1.b = {'abc', [4 5; 6 7]};

s1.c = 'Hello!';

save('newstruct.mat', '-struct', 's1');

% Save variables whose names contain digits:

save myfile.mat -regexp \d

See also load, whos, regexp, fileformats, hgsave, saveas, workspace, clear.

Overloaded methods:

COM/save

vdspdebug/save

ghsmulti/save

mdevproject/save

cgproject/save

vrworld/save

ccsdebug/save

Reference page in Help browser

doc save

<saveas> - Save Figure or model to desired output format.

SAVEAS Save Figure or Simulink block diagram in desired output format

SAVEAS(H,'FILENAME')

Will save the Figure or Simulink block diagram with handle H to file

called FILENAME.

The format of the file is determined from the extension of FILENAME.

SAVEAS(H,'FILENAME','FORMAT')

Will save the Figure or Simulink block diagram with handle H to file

called FILENAME in the format specified by FORMAT. FORMAT can be the

same values as extensions of FILENAME.

The FILENAME extension does not have to be the same as FORMAT.

The specified FORMAT overrides FILENAME extension.

Valid options for format are:

'fig' - save figure to a single binary FIG-file. Reload using OPEN.

'm' - save figure to binary FIG-file, and produce callable

MATLAB code file for reload.

'mfig' - same as M.

'mmat' - save figure to callable MATLAB code file as series of creation

commands with param-value pair arguments. Large data is saved

to MAT-file.

Note: MMAT Does not support some newer graphics features. Use

this format only when code inspection is the primary goal.

FIG-files support all features, and load more quickly.

Additional FORMAT options include devices allowed by PRINT.

NOTE: not all format options are allowed for Simulink block diagrams.

See the online help for more information.

Examples:

Write current figure to MATLAB fig file

saveas(gcf, 'output', 'fig')

Write current figure to windows bitmap file

saveas(gcf, 'output', 'bmp')

Write block diagram named 'demo' to an Encapsulated Postscript file

saveas(get_param('demo', 'Handle'), 'output', 'eps')

In the following list, SAVE_SYSTEM is available for Simulink users only.

See also load, save, open, print, save_system

Reference page in Help browser

doc saveas

<memory> - Help for memory limitations.

MEMORY Memory information.

See 'doc memory' for more information on how to make the

best use of memory when running MATLAB.

MEMORY when called without an output argument displays

information about how much memory is available and how

much is currently being used by MATLAB. All values are double

precision and in units of bytes.

USERVIEW = MEMORY returns information about how much memory is

available and how much is currently being used by MATLAB. USERVIEW

is a structure that contains the following fields:

MaxPossibleArrayBytes -- The largest contiguous free memory block.

It is an upper bound on the largest single array that MATLAB can

currently create. This field is the smaller of these two values:

a) The largest contiguous memory block found in the

MATLAB virtual address space, or

b) The total available system memory.

To find the number of elements, divide MaxPossibleArrayBytes

by the size of each element in bytes. For example, divide by

eight for a double matrix. The actual number of elements that

that can be created is always less than this number.

MemAvailableAllArrays -- The total amount of memory available

for data. This field is the smaller of these two values:

a) The total available MATLAB virtual address space, or

b) The total available system memory.

The amount of memory available is guaranteed to be at least

as large as this field.

MemUsedMATLAB -- The total amount of system memory reserved for the

MATLAB process. This is the sum of the physical memory and

potential swap file usage.

[USERVIEW, SYSTEMVIEW] = MEMORY returns additional, and more detailed

information about the current state of memory usage. SYSTEMVIEW is a

structure containing the following:

VirtualAddressSpace -- A 2-field structure that contains the

amount of available memory and the total amount of virtual

memory for the MATLAB process.

SystemMemory -- A 1-field structure that contains the amount of

available system memory. This number includes the amount of

available physical memory and the amount of available swap file

space on the computer running MATLAB.

PhysicalMemory -- A 2-field structure that contains the amount of

available physical memory and the total amount of physical memory

on the computer running MATLAB. It can be useful as a measure

of how much data can be accessed quickly.

The MEMORY function is currently available on PCWIN and PCWIN64 only.

Results will vary depending on the computer running MATLAB, the load

on the computer, and what MATLAB is doing at the time.

Example 1: Run the MEMORY command on a 32-bit Windows system:

>> memory

Maximum possible array: 677 MB (7.101e+008 bytes) *

Memory available for all arrays: 1602 MB (1.680e+009 bytes) **

Memory used by MATLAB: 327 MB (3.425e+008 bytes)

Physical Memory (RAM): 3327 MB (3.489e+009 bytes)

* Limited by contiguous virtual address space available.

** Limited by virtual address space available.

>>

Example 2: Run the MEMORY command on a 64-bit Windows system:

>> memory

Maximum possible array: 4577 MB (4.800e+009 bytes) *

Memory available for all arrays: 4577 MB (4.800e+009 bytes) *

Memory used by MATLAB: 330 MB (3.458e+008 bytes)

Physical Memory (RAM): 3503 MB (3.674e+009 bytes)

* Limited by System Memory (physical + swap file) available.

>>

Example 3: Run the MEMORY command with two outputs on a 32-bit Windows

system:

>> [uV sV] = memory

uV =

MaxPossibleArrayBytes: 710127616

MemAvailableAllArrays: 1.6797e+009

MemUsedMATLAB: 345354240

sV =

Соседние файлы в папке Библиотеки Matlab