How can I divide arrays into two as higher and lower?

2 Ansichten (letzte 30 Tage)
studentmatlaber
studentmatlaber am 25 Apr. 2021
Kommentiert: DGM am 25 Apr. 2021
I have two TV arrays. T array consists of 10 rows and 1 column. The Y array consists of 10 rows and 5 columns. I want it to compare the 1st row of the T array with all the links of the 1st row of Y array. Let the values of Y sequence assign to line 1 of another array with greater than T, and write to the smaller one on line 1 of another array. But I want these done for 24 lines as well. For this, I tried a code like this but I did not get the right result. I would be very happy if you could help.
T=[50;20;10;40;90;100;50;10;70;80;50]
Y=[83,69,13,50,77 ; 41,15,33,5,67; ...]
result;
signal=[83,69,50,77 ; 41,33,67 ; ...]
noise=[13 ; 15,5 ; ...]
for i=1:24
index = find(Y(i,:)> T(i,1), 1, 'first');
noise= Y(1:index);
signal= Y(index+1 : end);
end
  9 Kommentare
studentmatlaber
studentmatlaber am 25 Apr. 2021
@DGM thank you for code. it is running correctly.
DGM
DGM am 25 Apr. 2021
Glad to hear it

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Matrix Indexing 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