Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
 
 
主题工具 显示模式
旧 2007-05-22, 15:10   #2
chenhuips2
普通会员
 
注册日期: 2007-05-19
帖子: 51
声望力: 19
chenhuips2 正向着好的方向发展
默认

引用:
作者: ghmnjtu 查看帖子
我要用Matlab处理大量数据,一个个输入肯定不现实,请问 怎么在主程序中引用.txt的数据文件?
输入:help iofun
得到结果:
File input/output.

File import/export functions.
dlmread - Read delimited text file.
dlmwrite - Write delimited text file.
load - Load workspace from MATLAB (MAT) file.
importdata - Load workspace variables disk file.
wk1read - Read spreadsheet (WK1) file.
wk1write - Write spreadsheet (WK1) file.
xlsread - Read spreadsheet (XLS) file.

Image file import/export.
imfinfo - Return information about graphics file.
imread - Read image from graphics file.
imwrite - Write image to graphics file.
im2java - Convert image to Java image.

Internet resource.
urlread - Read the contents of a URL into a string.
urlwrite - Write the contents of a URL to a local file.
sendmail - Send e-mail.

Zip file access.
zip - Compress files into a zip file.
unzip - Extract the contents of a zip file.

Audio file import/export.
auread - Read NeXT/SUN (AU) sound file.
auwrite - Write NeXT/SUN (AU) sound file.
wavread - Read Microsoft WAVE (WAV) sound file.
wavwrite - Write Microsoft WAVE (WAV) sound file.

Video file import/export.
aviread - Read movie (AVI) file.
aviinfo - Return information about AVI file.
avifile - Create a new AVI file.
movie2avi - Create AVI movie from MATLAB movie.

Formatted file I/O.
fgetl - Read line from file, discard newline character.
fgets - Read line from file, keep newline character.
fprintf - Write formatted data to file.
fscanf - Read formatted data from file.
input - Prompt for user input.
textread - Read formatted data from text file.

String conversion.
sprintf - Write formatted data to string.
sscanf - Read string under format control.
strread - Read formatted data from text string.

File opening and closing.
fopen - Open file.
fclose - Close file.

Binary file I/O.
fread - Read binary data from file.
fwrite - Write binary data to file.

File positioning.
feof - Test for end-of-file.
ferror - Inquire file error status.
frewind - Rewind file.
fseek - Set file position indicator.
ftell - Get file position indicator.

File name handling
fileparts - Filename parts.
filesep - Directory separator for this platform.
fullfile - Build full filename from parts.
matlabroot - Root directory of MATLAB installation.
mexext - MEX filename extension for this platform.
partialpath - Partial pathnames.
pathsep - Path separator for this platform.
prefdir - Preference directory name.
tempdir - Get temporary directory.
tempname - Get temporary file.

CDF file handling
cdfread - Read data from a CDF file.
cdfinfo - Get information from a CDF file.
cdfwrite - Write data to a CDF file.
cdfepoch - Construct cdfepoch object.

HDF library interface help.
hdf - MEX-file interface to the HDF library.
hdfan - MATLAB Gateway to HDF multifile annotation interface.
hdfdf24 - MATLAB Gateway to HDF raster image interface.
hdfdfr8 - MATLAB Gateway to HDF 8-bit raster image interface.
hdfh - MATLAB Gateway to HDF H interface.
hdfhd - MATLAB Gateway to HDF HD interface.
hdfhe - MATLAB Gateway to HDF HE interface.
hdfml - MATLAB-HDF gateway utilities.
hdfsd - MATLAB Gateway to HDF multifile scientific dataset interface.
hdfv - MATLAB Gateway to HDF V (Vgroup) interface.
hdfvf - MATLAB Gateway to HDF VF (Vdata) interface.
hdfvh - MATLAB Gateway to HDF VH (Vdata) interface.
hdfvs - MATLAB Gateway to HDF VS (Vdata) interface.

HDF-EOS library interface help.
hdfgd - MATLAB Gateway to HDF-EOS grid interface.
hdfpt - MATLAB Gateway to HDF-EOS point interface.
hdfsw - MATLAB Gateway to HDF-EOS swath interface.

XML file handling
xmlread - Parse an XML file and return a Document Object Model node.
xmlwrite - Serialize an XML Document Object Model node.
xslt - Transform an XML document using an XSLT engine.

Serial port support.
serial - Construct serial port object.

Timer support.
timer - Construct timer object.

Command window I/O
clc - Clear command window.
disp - Display array.
home - Send cursor home.
input - Prompt for user input.
pause - Wait for user response.

FIG file support for plotedit and printframes.
hgload - Loads a Handle Graphics object from a file.
hgsave - Saves an HG object hierarchy to a file.

Utilities.
str2rng - Convert spreadsheet range string to numeric array.
wk1const - WK1 record type definitions.
wk1wrec - Write a WK1 record header.


没看到可以直接读取TXT文件,
但是可以直接读取XLS文件,
使用xlsread(‘文件名’)命令读取。
chenhuips2 当前离线   回复时引用此帖
 

主题工具
显示模式

发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码



所有时间均为北京时间。现在的时间是 19:30


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.