xclgetdata.m

来自「PLS_Toolbox是用于故障检测与诊断方面的matlab工具箱」· M 代码 · 共 27 行

M
27
字号
function xmat = xclgetdata(filename,datarange)
%XCLGETDATA extracts a matrix from an Excel spreadsheet
%  Inputs are (filename) a text string containing the
%  file name of the OPEN Excel spreadsheet and (datarange)
%  a text string containing the range in the spreadsheet
%  that contains the data matrix in row/column format. 
%  The output (xmat) is the MATLAB matrix.
%
%Note: This function only works on a PC and the spreadsheet
%  must be open in Office 97 or higher. For Mac see XLGETRANGE.
%
%Example: to get a table of data from the range C2 to T25
%         from the open workbook 'book1.xls':
%     data = xclgetdata('book1.xls','r2c3:r25c20')
%
%I/O: xmat = xclgetdata(filename,datarange);
%
%See Also: AREADR1, XCLPUTDATA, XCLREADR

%Copyright Eigenvector Research, Inc. 1999 - 2000
%nbg 1/99
%nbg 11/00 added XCLREADR

chan  = ddeinit('excel',filename);
xmat  = ddereq(chan,datarange);
rc    = ddeterm(chan);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?