Filter löschen
Filter löschen

I would like to pick the consecutive cells those satistfies my given condition

2 Ansichten (letzte 30 Tage)
I have a array of 122 by 10 data set. I have given the criteria to pick the cells whose values are greather than equal to 1.
Now I would like to pick the cells which satisfies the above condition and those satisfies cells are consecutively aranged.
For Ex: Cell 25,26,27,31 are satisfiying the above creiteria . But I wanted to highligh or list out the greter than or equal to 3 consecutive cells, which mean it has to highlight cell25,26,27
  1 Kommentar
Matt J
Matt J am 11 Mai 2022
Consecutively along columns? And, to be clear, when you say "cell" you don't really mean a cell array, right?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Matt J
Matt J am 11 Mai 2022
Bearbeitet: Matt J am 11 Mai 2022
You might benefit from downloading,
Then you can label consecutive groups of true elements with, e.g.,
a=rand(1,10)+randi([0,1],1,10)
a = 1×10
0.0060 1.1285 1.2700 0.9325 0.1607 0.3040 0.0583 1.7232 0.4577 1.9700
G=groupTrue(a>1)
G = 1×10
0 1 1 0 0 0 0 2 0 3
  9 Kommentare
Matt J
Matt J am 12 Mai 2022
Bearbeitet: Matt J am 12 Mai 2022
How is it wrong? The 6 elements that it returns are indeed consecutively arranged in X.
X=[-1.19 -0.94 -0.78 -0.47 -0.28 -0.22 1.05 1.23 0.78 1.55 1.45 1.00];
X(1:6)<=0.5
ans = 1×6 logical array
1 1 1 1 1 1
Poorna Durga Geesupalli
Poorna Durga Geesupalli am 13 Mai 2022
It has to pick the values <=-0.5
The above code is picking the values -0.28 -0.22 too.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type 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!

Translated by