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 Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by