basic knowledge of MATLAB
2017-10-14 11:02
330 查看
MATALB is short for Matrix Laboeratory --which is used for algorithm develoment,data visualization,data analysis and numerical
calculation--including MATLAB,Simulink and dozens of professional toolboxes.
The basic dta unit of MATLAB is matrix.
DATA TYPE
MATLAB includes 15 basic data types,they are eight kinds od integer,single,double,logical,char,cell,struct and function_handle.
double is the default data type
8-bit unsigned integer
floating-point number: single and double
We can get the range of integer by 'intmin()' and 'intmax' ;
we can get the range of floating-point numer by 'realmin()' and 'realmax()'
stucture node(结构体类型)
MATLAB 中的结构体类似于C语言的结构体数据结构。结构体是按照成员变量名组织起来的饿不同数据类型数据的集合。每个成员变量用指针操作符“.”表示。
函数struct():采用函数struct()产生结构体变量,该函数的调用格式为:S=struct('field1',values1,'field2',values2,....),其中field1和field2等为成员变量名,value1和value2等成员变量的具体值。
cell arry(单元数组)
Cell arry is a special data type,and each of it's elements exists as cell.
Using {} or function cell() to build a cell arry.
Function:
(a) cell():to generate a cell arry
cell(N) generate an N× N empty cell arry.
cell(M,N) or cell([M,N])
cell(M,N,P,...)
cell(size()):to generate a cell arry which has the same dimension with A.
(b) celldisp(): to display the content of the cell arry
celldisp(C)
celldisp(C,'name'):use 'name' to display the content of C
(c) cellplot():use color graphics to display the structure of a cell arry
H=cellplot(c):return is a vector which embodies surface,line and handle(句柄)
H=cellplot(c,,'legend'):add note'legend' to the figure
(d) iscell():to judge whether a variable is cell arry or not
(e) cell2struct() and num2cell
S=cell2struct(C,fields,dim) :transform a cell arry C into structure variable S which diemention is dim.
C=num2cell(A): transform a numerical matrix A into a cell arry C
operator(运算符)
arithmetic operator(算术运算符)
relational operator(关系运算符):
logical operator(逻辑运算符):and or not xor(逐个元素的逻辑运算)
&& ||(快速逻辑运算)
逐位逻辑运算 函数 bitand(a,b)
bitor(a,b) bitnor(a,b) bitcmp(a,b)逐位逻辑非
date and time
clock(): acquire current date, including year, month,day, hour, minute and second.
date(): acquire current date,return is string,format is dd-mmm-yyyy
now(): return current date expressing with double
calendar()
calculation--including MATLAB,Simulink and dozens of professional toolboxes.
The basic dta unit of MATLAB is matrix.
DATA TYPE
MATLAB includes 15 basic data types,they are eight kinds od integer,single,double,logical,char,cell,struct and function_handle.
double is the default data type
8-bit unsigned integer
floating-point number: single and double
We can get the range of integer by 'intmin()' and 'intmax' ;
we can get the range of floating-point numer by 'realmin()' and 'realmax()'
stucture node(结构体类型)
MATLAB 中的结构体类似于C语言的结构体数据结构。结构体是按照成员变量名组织起来的饿不同数据类型数据的集合。每个成员变量用指针操作符“.”表示。
函数struct():采用函数struct()产生结构体变量,该函数的调用格式为:S=struct('field1',values1,'field2',values2,....),其中field1和field2等为成员变量名,value1和value2等成员变量的具体值。
cell arry(单元数组)
Cell arry is a special data type,and each of it's elements exists as cell.
Using {} or function cell() to build a cell arry.
Function:
(a) cell():to generate a cell arry
cell(N) generate an N× N empty cell arry.
cell(M,N) or cell([M,N])
cell(M,N,P,...)
cell(size()):to generate a cell arry which has the same dimension with A.
(b) celldisp(): to display the content of the cell arry
celldisp(C)
celldisp(C,'name'):use 'name' to display the content of C
(c) cellplot():use color graphics to display the structure of a cell arry
H=cellplot(c):return is a vector which embodies surface,line and handle(句柄)
H=cellplot(c,,'legend'):add note'legend' to the figure
(d) iscell():to judge whether a variable is cell arry or not
(e) cell2struct() and num2cell
S=cell2struct(C,fields,dim) :transform a cell arry C into structure variable S which diemention is dim.
C=num2cell(A): transform a numerical matrix A into a cell arry C
operator(运算符)
arithmetic operator(算术运算符)
relational operator(关系运算符):
logical operator(逻辑运算符):and or not xor(逐个元素的逻辑运算)
&& ||(快速逻辑运算)
逐位逻辑运算 函数 bitand(a,b)
bitor(a,b) bitnor(a,b) bitcmp(a,b)逐位逻辑非
date and time
clock(): acquire current date, including year, month,day, hour, minute and second.
date(): acquire current date,return is string,format is dd-mmm-yyyy
now(): return current date expressing with double
calendar()
相关文章推荐
- Basic knowledge of R
- Memory space manipulating in Java(Section three:Basic Knowledge of Java Process Heap )
- Basic knowledge of html (keep for myself)
- The basic knowledge of deep learning
- Basic Knowledge of Jaw Crusher Operation
- Basic knowledge of javaScript (keep for myself)
- Basic knowledge of HTML
- Basic knowledge of SSRS
- Some Basic Knowledge Points of Python Programming
- Basic Concepts of Microsoft .Net Framework
- Please change your current directory to a writable directory preferably outside of MATLAB installati
- web of knowledge分析文献引用情况(引)
- Learn Basic Introduction & preliminaries of HP
- root/user basic knowledge...
- Basic Example Of RTimer
- Basic configuration of Products
- Basic Theory of Physically-Based Rendering
- Basic knowledge you should __allways__ keep in mind !!!
- 【MongoDB】The basic operation of Index in MongoDB
- Master the game of Go without human knowledge