How to get certain matrix columns.
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Santos García Rosado
am 21 Apr. 2021
Kommentiert: Santos García Rosado
am 21 Apr. 2021
Hello,
I'm having trouble trying to get certain matrix columns. Let's say I have Matrix A:
A = [1 2 3 4 5 6 7 8 9 10 11 12; 13 14 15 16 17 18 19 20 21 22 23 24]
Let's say I'd like to get every third value starting in position 1. Then I would use this code:
A(:,1:3:end)
My issue is that I'd like to skip four positions and get the next two. This would be my output if I started from the first position:
Output = [1 2 7 8; 13 14 19 20]
I could get every column manually but since I'm working with big matrixes and different sizes it woldn't be convininient.
Can someone come around a solution for this?
Thnak you in advance,
Santos
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!