资源简介
每年全国大学生数学建模竞赛都有不少是excel数据,怎么把数据导入Matlab就成了首先要解决的问题,Matlab自带那个函数不怎么好用,现在这个名为ReadFromExcel的函数很好的解决了这个问题,支持中文和混合数据,有例子,希望对大家有帮助,另参见
http://download.csdn.net/source/2077050

代码片段和文件信息
function varargout = readfromexcel(filelocvarargin)
% VARARGOUT = READFROMEXCEL(FILELOCVARARGIN)
%
% Uses ActiveX commands to read range(s) from an existing Excel
% spreadsheet.
%
% FILELOC: Enter a string representing the (absolute or relative)
% location of an Excel file. (Extension may be
% omitted and will be assumed to be .xls.)
% Examples: ‘c:\brett\my archives\test1.xls‘
% ‘test1.xls‘
% ‘myarchive‘
%
% SHEETNAME: (Optional): Any occurrence in the variable argument list of
% the strings ‘sheetname‘ or ‘sheet‘ prompts the function to change
% active sheets to the value in the following variable. That specifier
% must be a string argument matching exactly the name of an existing
% sheet in the opened file. If this argument is omitted the function
% defaults to reading from the first sheet in the file.
%
% RANGE SPECIFIER(S): Enter the range(s) to read. The values stored in these
% ranges will be returned in consecutive output arguments.
% Example: ‘B1:B5‘
% ‘B1:B1‘ (or simply ‘B1‘)
% ‘B1:P4‘
% ‘B:B‘ or ‘B‘ (Entire second column)
% ‘2:2‘ or ‘2‘ (Entire second row)
% ‘ALL‘ (Entire sheet)
% (Additional ranges: Comma separated ranges in the same form as above;
% contents of archive will be returned in output arguments
% 2...n)
%
% NOTE: Specifying range as ‘ALL‘ returns entire used portion of sheet;
% Specifying range as ‘B:B‘ or ‘2:2‘ returns
% appropriate row of UsedRange. (Data are selected in
% block form as for ‘ALL‘ then the selected row/column
% is returned.
%
% OUTPUT: If specified range is 1 cell variable returned is of the same
% class as cell contents. If the range spans more than 1 cell the variables will be cell arrays.
%
% EXAMPLES: a = readfromexcel(‘c:\brett\my archives\test1.xls‘‘C1:C5‘);
% reads from the currently active sheet
% [ab] = readfromexcel(‘c:\brett\my archives\test1.xls‘‘sheet‘‘sheet2‘‘C1:C5‘‘C1:P3‘);
% reads from sheet2
% [abc] = readfromexcel(‘myarchive‘‘C3:D5‘‘sheet‘‘mysheet‘‘E4‘‘sheet‘‘sheet2‘‘B3‘);
% reads a from currently active sheet switches to sheet
% ‘mysheet‘ to read b then to sheet ‘sheet2‘ to read c.
%
% Written by Brett Shoelson Ph.D.
% shoelson@helix.nih.gov
% Update History: 1/04. Version 1.
% 2/2/04. Now allows multiple specifications of sheet na
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 103 2010-04-01 23:01 data.txt
文件 54 2010-04-01 23:09 kq2010.txt
文件 1335 2009-05-26 09:51 ReadFromExcel\license.txt
文件 8586 2009-05-26 09:51 ReadFromExcel\ReadFromExcel.m
文件 325433 2010-04-01 22:53 MATLAB Central - File detail - readfromexcel.mht
文件 13824 2010-04-01 22:59 data.xls
文件 29696 2010-04-01 23:06 kq2010.xls
目录 0 2010-04-01 22:55 ReadFromExcel
----------- --------- ---------- ----- ----
379031 8
相关资源
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论