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

조회 수: 1 (최근 30일)
studentmatlaber
studentmatlaber 2021년 4월 25일
댓글: DGM 2021년 4월 25일
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
studentmatlaber
studentmatlaber 2021년 4월 25일
@DGM thank you for code. it is running correctly.
DGM
DGM 2021년 4월 25일
Glad to hear it

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by