Help with linear optimisation problem
1 次查看(过去 30 天)
显示 更早的评论
Hi folks,
I'm looking to conduct a linear optimisation and was hoping for some help on the matter.
I have 56 columns of data, with 256 rows each; lets call this set A. I have another column of data, with 56 rows; lets call this set B. I essentially want to correlate each of the 256 values in each column of set A to a single value in set B; lets call this set C.
I want to know which of the 256 values across set C give the best correlation between sets A and B. In other words, which row in set A gives the best correlation to the corresponding value in set B, across all columns of set A.
Any help on this matter would be most appreciated!
0 个评论
采纳的回答
Matt J
2022-1-25
编辑:Matt J
2022-1-25
Diffs=abs(reshape(B,1,1,[])-A);
d=min(Diffs,[],3);
[Arows,Acols]=find(d==min(d(:)));
更多回答(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!