xls2mat

バージョン 1.1.0.0 (2.45 KB) 作成者: Matthew Kelly
converts a spreadsheet file to a Matlab struct
ダウンロード: 228
更新 2015/12/13

ライセンスの表示

% DATA = xls2mat(In_File_Name,Out_File_Name)
%
% Take an excel spreadsheet and convert it to a matlab struct,
% with a field for each column in the spreadsheet.
%
% This function xls2mat, assumes a special structure in the spreadsheet
% file, described in detail below.
%
%
%
% INPUTS:
% In_File_Name must be a .xls extension
% Out_File_Name must be a .mat extension
%
%
% OUTPUTS:
% DATA = a struct with one field for each column in the spreadsheet, and
% the name of the field will be the name of the column. If the data in
% the given column is strings, then the corresponding field will be a
% cell array. If it is numeric, then the field will be a column vector.
%
% If the second argument is present, then DATA will be written to a .mat
% file.
%
%
%
% NOTES:
%
%
% This function assumes a special structure in the spreadsheet:
%
% 1) The first row is a header row of strings. These strings must be valid
% matlab variable names, and they must be unique (or they will be
% overwritten).
%
% 2) Each column has a consistent data type (numerical or string)
%
% 3) There must be no blank columns, or blanks in the first row of data
%
%
%
% This function is built around xlsread(), and thus will work on any files
% that are correctly recognized by xlsread(). Type
% >> help xlsread
% for additional details regarding this.
%

引用

Matthew Kelly (2024). xls2mat (https://www.mathworks.com/matlabcentral/fileexchange/54461-xls2mat), MATLAB Central File Exchange. に取得済み.

MATLAB リリースの互換性
作成: R2012a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersSpreadsheets についてさらに検索
謝辞

ヒントを得たファイル: XLS2STRUCT, xls2struct, xls2struct

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.1.0.0

1) Cleaned up documentation.
2) Added functionality - if called with single argument, return struct instead of writing .mat file.

1.0.0.0