How can I divide arrays into two as higher and lower?
2 次查看(过去 30 天)
显示 更早的评论
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
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!