爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 10857|回复: 0

[参考资料] Matlab学习笔记

[复制链接]

新浪微博达人勋

发表于 2020-12-24 15:06:13 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
1.    dir
dir lists files and folders in the current folder.(列出文件夹里的内容)
dir name lists files and folders that match name. When name is afolder, dir lists the contents of the folder. Specify name using absolute orrelative path names. The name argument can include the * wildcard in the filename, and both the * and the ** wildcard in the path name. Characters next to a** wildcard must be file separators.
listing = dir(name) returns attributes about name.

2.length
Length of largest array dimension (矩阵最大维度的长度)
L = length(X)
L = length(X) returns the length of the largest array dimension inX. For vectors, the length is simply the number of elements. For arrays withmore dimensions, the length is max(size(X)). The length of an empty array iszero.

3.[ ]
用于赋空值

4. size
Array size
[m,n] = size (A) returns the number of rows and columns when A is amatrix.
5.strfind
Find one string within another
K=strfind (str,pattern)(在str的字符串中查找pattern样品字符)
searches str for occurrences of pattern. The output, k, indicatesthe starting index of each occurrence of pattern in str. If pattern is notfound, then strfind returns an empty array, []. The strfind function executes acase-sensitive search.
6.str2double
把字符串转换为数值,可用str2num代替。
x = str2num('str')         str是一个ASCII字符串表示的数值,这种调用格式把字符串转换成数值,str也可以是一个字符串矩阵,这种情况下,字符串矩阵被转换成一个数值矩阵。
当str为数值字符时,str2double和str2num两个函数一样;当str为非数值字符时,两个函数不同如:str = 'a';
a1 = str2num(str);      %a1=[]
a2 = str2double(str);   %a2=NaN, 非数
7.find
找到非零值的位置
8.isempty
TF = isempty(A)     returnslogical 1 (true) if A is an empty array and logical 0 (false) otherwise.  An empty array has at least one dimension ofsize zero, for example, 0-by-0 or 0-by-5.
9.fopen
获取整数文件标识符
FileID=fopen(filename)  opens the file, filename, for binary read access, and returns an integerfile identifier equal to or greater than 3. MATLAB® reserves file identifiers0, 1, and 2 for standard input, standard output (the screen), and standarderror, respectively.
If fopen cannot open the file, then fileID is -1.
Fopen常搭配 fclose(fileID) closes an open file.
10.feof
Test for end-of-file.
status = feof(fileID)    returns 1 if a previous operation set the end-of-file indicator for thespecified file. Otherwise, feof returns 0. fileID is an integer file identifierobtained from fopen.
Opening an empty file does not set the end-of-file indicator. Readoperations, and the fseek and frewind functions, move the file positionindicator.


密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表