-
大小: 99KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-06-10
- 语言: Matlab
- 标签: matlab xls ReadFromExce
资源简介
每年全国大学生数学建模竞赛都有不少是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
相关资源
- 区域增长(Region Growing)算法Matlab代码
- matlab过电压仿真
- 天河二号上安装使用MATLAB的说明
- 中心差分格式的数值试验含MATLAB源码
- MATLAB读取TDMS文件函数
- 用matlab实现自适应图像阈值分割最大
- 基于matlab灰色模型GM(1,1)预测数据
- matlab100篇经典
- KL距离matlab实现
- 共轭梯度法的matlab程序
- matlab中hanning汉宁窗设计数字高通滤波
- matlab中低通IIR巴特沃斯滤波器的设计
- 最有潮流计算程序matlab
- 热电联产CGAM问题建模
- 根据四张纸牌计算24matlab程序
- 小波矩特征提取matlab代码
- 画标注框(matlab程序)
- 血管的三维重建
- 数字图像处理MATLAB2015版 源代码
- 读取DICOM数据,并截图
- MATLAB复杂网络工具箱使用手册
- MATLAB-BOXFILTER
- matlab MMN排队源文件
- 发动机万有特性制作程序MATLAB
- 惯性导航仿真实现源代码
- 小波变换的图像去噪的matlab程序的源
- 多目标粒子群优化算法MATLAB
- 基于matlab的彩色图像的分割算法
- GPS L5软件MATLAB仿真接收机,根据经典
- 2份BPSK调制解调仿真的MATLAB代码,其中
评论
共有 条评论