Selecting more than one range of elements of a vector with a single line code
49 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Gennaro Arguzzi
am 8 Dez. 2018
Kommentiert: Gennaro Arguzzi
am 8 Dez. 2018
Hello everyone,
i'm wondering if it's possible to select more than one range of elements of a vector with a single line code.
For example, given the vector a=[1,2,3,...,100], i'd like to select the two ranges [1,...,10] and [90,...,100]. I know that matlab allows to select only a continous range, e.g.:
a = 1:1:100;
b = a(1+89:100);
Thank you very much in advance.
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!