Get several subsets from a set using two arrays.
Ältere Kommentare anzeigen
Hello.
For example.
I have the following set:
exSet = 21:40;
And 2 arrays, one with the indexes of the lower position and the second with the indexes of the higher position.
Lower position array:
lPos = [2 8];
Upper position array:
uPos = [11 16];
The resulting subsets are:
subSet1 = extSet(lPos(1) : uPos(1)) = 22:31;
subSet2 = extSet(lPos(2) : uPos(2)) = 28:36;
But, I want to do this in a single step because both my set exSet and the arrays have much more elements.
To avoid a for loop, I will appreciate suggestions.
Best Regards,
2 Kommentare
Massimo Zanetti
am 28 Sep. 2016
What do you mean by "in a single step"?
Tiago Marçal
am 28 Sep. 2016
Akzeptierte Antwort
Weitere Antworten (1)
Tiago Marçal
am 29 Sep. 2016
0 Stimmen
Kategorien
Mehr zu Data Type Identification 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!