正在加载图片...
Thinking in a Matrix Wav 9 A3x4 matrix A 4x1(column)vector A1X4(row)vector 「353 6 4 [512-21] -93149 7 7 0 -2112 Fig.1.2 Matrices of various dimensions If you are familiar with the spreadsheet software Excel,you can imagine each Excel worksheet as a matrix,with rows and columns. Now let's try to define some matrices and vectors in MATLAB.Type the follow. ing statements as written: >a=[3,5,7,8] <ENTER> a■ 512-2 1 >b=【4;2:7:1] <ENTER> b= 9 7 >c=[3,53,6:12,-93,145:4,7,1:0,-21,121 <ENTER> c= 53 6 12 -93 145 4 0 -21 12 >>whos KENTER> Name Size Bytes Class Attributes 1×4 32 double 6 4×1 32 double 4×3 96 double number 1xl double nd each variable is displayed toge mns.(Note:if you have used other variable previously.your list of variables could be different).Note that a scalar value,like the variable number,can be considered a 1x I matrix. Thinking in a Matrix Way 9 If you are familiar with the spreadsheet software Excel, you can imagine each Excel worksheet as a matrix, with rows and columns. Now let’s try to defi ne some matrices and vectors in MATLAB. Type the follow￾ing statements as written: >> a=[3,5,7,8] <ENTER> a = 5 12 -2 1 >> b= [4;2;7;1] <ENTER> b = 4 2 7 1 >> c= [3, 53,6;12,-93,145;4,7,1;0,-21,12] <ENTER> c = 3 53 6 12 -93 145 4 7 1 0 -21 12 >> whos <ENTER> Name Size Bytes Class Attributes a 1x4 32 double b 4x1 32 double c 4x3 96 double number 1x1 8 double As you can see, after the command whos , each variable is displayed together with its size expressed in rows × columns. (Note: if you have used other variables previously, your list of variables could be different). Note that a scalar value, like the variable number , can be considered a 1 × 1 matrix. Fig. 1.2 Matrices of various dimensions
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有