Selecting Every Other Element in a Matrix
Ältere Kommentare anzeigen
How can I select every other element in a matrix, such as A=[1 2 8 7 6 5 4 6]?
Akzeptierte Antwort
Weitere Antworten (1)
prashanth GT
am 2 Mär. 2020
0 Stimmen
function y = everyOther(x)
y = x(1:2:length(x));
end
Kategorien
Mehr zu Operating on Diagonal Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!