标签:Onramp rand Arrays into Indexing column MATLAB row
Vectors and Matrices
Array Creation Functions
创建随机数矩阵
x = rand(2)
x =
0.8147 0.1270
0.9058 0.9134
x = rand(2,3)
x =
0.6324 0.2785 0.9575
0.0975 0.5469 0.9649
获得已知矩阵的大小
size(x)
Indexing into and Modifying Arrays
Indexing into Arrays (Indexing into Arrays)
%You can extract values from an array using *row, column indexing*.
y = A(5,7)
%This syntax extracts the value in the 5th row and 7th column of `A`
%and assigns the result to the variable `y`.
If you only use one index with a matrix, it will traverse down each column in order.
按列分配
%When used as an index, the colon operator (`:`) specifies all the elements in that dimension. The syntax
% 行
x = A(2,:)
% 列
y = A(:,2)
%creates a row vector containing all of the elements from the second row of `A`.
x = A(1:3,:)%三行
volumes=data(:,3:4)%3 4列
标签:Onramp,rand,Arrays,into,Indexing,column,MATLAB,row 来源: https://www.cnblogs.com/junecyane/p/15354597.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。