Selecting Every Other Element in a Matrix
显示 更早的评论
How can I select every other element in a matrix, such as A=[1 2 8 7 6 5 4 6]?
采纳的回答
更多回答(1 个)
prashanth GT
2020-3-2
0 个投票
function y = everyOther(x)
y = x(1:2:length(x));
end
类别
在 帮助中心 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!