loadFields from mat files

Loads a field from a number of mat files.

You are now following this Submission

Sometime you need a specific field from a (large) number of mat files. With loadFields, the user can select all the mat files at once, and choose the required field using a pulldown menu. The values are returned as a single array if the field has always the same size, otherwise it returns a cell.

%USAGE:
%data = loadFields returns the values of a structure field
%from one or more files. User is prompted for the required field. If all
%struct fields contain a 1-by-n or n-by-1 matrix of the same size ,
%loadFields will create a single concatated array. In all other occasions,
%loadFields creates a cell with each field containing the field of a
%file.
%
%[data files] = loadFields returns the values of a structure
%field from one or more files, and files used.
%
%[data files fields] = loadFields returns the values of a strucure
%field, the files used, and the selected fields
%
% ... = loadFields(fields) returns the values of the structure fields
% in 'fields'

Cite As

Arthur (2026). loadFields from mat files (https://www.mathworks.com/matlabcentral/fileexchange/30459-loadfields-from-mat-files), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired by: Standalone Pulldown Menus

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0