matlab中fid=fopen('magic.m','r') 其中fid 和 r 分别代表什么含义

 我来答
fengyeyuanlin
推荐于2018-03-01 · TA获得超过1504个赞
知道小有建树答主
回答量:475
采纳率:60%
帮助的人:228万
展开全部
fopen

Open file, or obtain information about open files

Syntax

fid = fopen(filename)
fid = fopen(filename, mode)
[fid, message] = fopen(filename, mode, machineformat)
[fid, message] = fopen(filename, mode, machineformat, encoding)
fids = fopen('all')
[filename, mode, machineformat, encoding] = fopen(fid)

Description

fid = fopen(filename) opens the file filename for read access. (On PCs, fopen opens files for binary read access.)

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).
简而言之,r表示打开问文件是为了读取数据
fid值表示是否成功
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式