globalLoad.m

버전 1.0.0.0 (2.04 KB) 작성자: Gerald Dalley
Loads a .mat file's variables into the global namespace
다운로드 수: 1.6K
업데이트 날짜: 2006/2/21

라이선스 없음

%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);
%

인용 양식

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

MATLAB 릴리스 호환 정보
개발 환경: R14SP2
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0

Removed boilerplate copyright.