ydliu_zn 发表于 2006-10-19 10:30

文件操作的疑问?

fid = fopen(filename);表示打开文件并把文件名保存到一个变量中,但我在实际的一个练习中发现只是保存一个double型数字到fid中,怎么回事?

happy 发表于 2006-10-19 11:03

看一下相关帮助吧
fid is a scalar MATLAB integer, called a file identifier. You use the fid as the first argument to other file input/output routines. If fopen cannot open the file, it returns -1. Two file identifiers are automatically available and need not be opened. They are fid=1 (standard output) and fid=2 (standard error).

ydliu_zn 发表于 2006-10-19 11:53

谢谢happy,你说的是关于fid本身的,其实我这里可以换成a = fopen(filename);,因该行吧?

happy 发表于 2006-10-19 15:06

原帖由 ydliu_zn 于 2006-10-19 11:53 发表
谢谢happy,你说的是关于fid本身的,其实我这里可以换成a = fopen(filename);,因该行吧?

fid只是个变量名称而已,只要符合规范可以自己任意定义
页: [1]
查看完整版本: 文件操作的疑问?