Matrix consisting of sub-elements of another matrix
2 次查看(过去 30 天)
显示 更早的评论
采纳的回答
Matt J
2020-2-18
编辑:Matt J
2020-2-18
3 个评论
Matt J
2020-2-18
There are lots of indexing techniques described at the link I gave you. For example, you can get every 3rd element with this syntax,
x=rand(1,137);
y=x(1:3:end);
You can also get all elements satisfying some condition with logical indexing, e.g.,
y=x(x>0.5);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!