MATLAB英文原版.pptVIP

  • 30
  • 0
  • 约7.01千字
  • 约 28页
  • 2017-07-27 发布于河南
  • 举报
MATLAB英文原版

Chapter 2;2.1 Variables and arrays The fundamental unit of data in any MATLAB program is the array. Vectors: only one dimension Matrices: two or more dimension Size of array: row number ×column number The regulation of variable name: It must begin with a letter, followed by any combination of letters, numbers and the underscore character.;Programming practice: Always give your variables descriptive and easy-to-remember names. How to create a data dictionary? The MATLAB language is case-sensitive. While it is not required, it is customary to use all lowercase letters for ordinary variable names.;Type of variable: double (64-bit) : the principal data type in MATLAB Char(16-bit) C language is strongly typed, while MATLAB is weakly typed. 2.2 initializing variables in MATLAB Assign data to the variable in an assignment statement Input data into the variable from the keyboard. Read data from files.;Type of variable: double (64-bit) : the principal data type in MATLAB Char(16-bit) C language is strongly typed, while MATLAB is weakly typed. 2.2 initializing variables in MATLAB Assign data to the variable in an assignment statement Input data into the variable from the keyboard. Read data from files.;Initializing variables in assignment statements var=expression Variable can be initialized with arrays of data. Individual values within a row are separated by blank spaces or commas, and the rows themselves are separated by semicolons or new lines. How to create an empty array? It is not the same as an array containing zeros. It exists exactly.;Programming pitfalls: The number of elements in every row of an array must be the same. The number of elements in every column must be the same. Use semicolon to suppress echoing, this will greatly speeds program execution. Initializing with shortcut expressions first : incr : last If the increment is one, it may be omitted.;Transpose operat

文档评论(0)

1亿VIP精品文档

相关文档