- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Linear Indexing
You can refer to the elements of a MATLAB matrix with a single subscript, A(k). MATLAB stores matrices and arrays not in the shape that they appear when displayed in the MATLAB Command Window, but as a single column of elements. This single column is composed of all of the columns from the matrix, each appended to the last.
So, matrix A
A = [2 6 9; 4 2 8; 3 5 1]
A =
2 6 9
4 2 8
3 5 1
is actually stored in memory as the sequence
2, 4, 3, 6, 2, 5, 9, 8, 1
Relational Operators , ,=,=,==,~=
If one of the operands is a scalar and the other a matrix, the scalar expands to the size of the matrix. For example, the two pairs of statements
X = 5; X = [1 2 3; 4 5 6; 7 8 10]
X = 5*ones(3,3); X = [1 2 3; 4 5 6; 7 8 10]
produce the same result:
ans =
1 1 1
1 1 0
0 0 0
find
Find indices and values of nonzero elements
ind = find(X) locates all nonzero elements of array X, and returns the linear indices of those elements in vector ind. If X is a row vector, then ind is a row vector; otherwise, ind is a column vector. If X contains no nonzero elements or is an empty array, then ind is an empty array.
[row,col] = find(X, ...) returns the row and column indices of the nonzero entries in the matrix X.
Find函数与矩阵下标
A= magic(4)
A =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
A10 按位比较后,返回一个矩阵
ans =
1 0 0 1
0 1 0 0
0 0 0 1
0 1 1 0
find(A10) 返回一个矩阵(非零元素)的linear indices
ans =
1
6
8
12
13
15
A(A10)
ans =
16
11
14
15
13
12
A(find(A10))
ans =
16
11
14
15
13
12
Using Logicals in Array Indexing
A logical array index designates the elements of an array A based on their position in the indexing array, B, not their value. In this masking type of operation, every true
您可能关注的文档
最近下载
- GB 55007-2021砌体结构通用规范.pdf VIP
- 国开电大学习网《高级财务会计》形考任务答案1-5答案.pdf VIP
- 部编版道德与法治四年级下册第四单元感受家乡文化关心家乡发展 3 大单元整体作业设计.pdf
- 石家庄市国企招聘考试真题题库2024版 .pdf VIP
- 个人岗位述职报告范文.docx VIP
- 2024石家庄市国企招聘考试真题及答案.docx VIP
- 基于FACE技术探究二氧化碳与移栽密度对汕优63颖花形成的互作效应.docx VIP
- 2025年产前筛查诊断人员资质考试历年参考题库及答案.docx VIP
- 2023年河北石家庄市市属国有企业公开招聘管理人员及专业技术人员257人笔试备考试题及答案解析.docx VIP
- 2024大学生职业生涯规划书(28篇).pdf VIP
原创力文档


文档评论(0)