globalLoad.m

Loads a .mat file's variables into the global namespace
1,6K descargas
Actualizado 21 feb 2006

Sin licencia

%GLOBALLOAD(FNAME, VARNAME1, VARNAME2, ...)
% Loads a .mat file's variables into the global namespace, but only if at
% least one variable-to-be-loaded is zero-length. Example:
% globalLoad('foo.mat', 'bar', 'baz')
% is basically equivalent to:
% global bar baz;
% if (length(bar) == 0) || (length(baz) == 0)
% load foo.mat bar baz;
% end
% This function is useful if you have very large static data structures that
% would be too expensive to load into memory every time they are needed and
% when it would not be practical to pass them in as parameters to functions
% that need them.
%
%GLOBALLOAD(FNAME)
% Loads all variables from the .mat file into the global namespace.
%
%GLOBALLOAD(FNAME, ..., '-checksizes')
% Loads variables if any of their sizes do not match the size in the file.
% This is a stronger check than is normally made. This version is generally
% slower than the others because it must do a scan of the .mat file to read
% the variable sizes.
%
%In all cases, the global variables are defined in the caller's symbol
%table. For example, the following code is valid (assuming fooData.mat
%contains a variable bar):
% function foo
% globalLoad('fooData.mat', 'bar');
% disp(bar);
%

Citar como

Gerald Dalley (2024). globalLoad.m (https://www.mathworks.com/matlabcentral/fileexchange/10003-globalload-m), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R14SP2
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Workspace Variables and MAT-Files en Help Center y MATLAB Answers.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0

Removed boilerplate copyright.