我需要在MATLAB中具有不同行数的两列中找到等效数据
我正在尝试在Matlab(2016a)中编写一些代码。我有一个28x1
矩阵库。我有我的计算结果发现的数据。这些是595x1
矩阵的形式。我想将数据中的每个数据与库中的数据匹配,并将匹配数据输出到屏幕上。列的数量相等,但行的数量不是。我发现的数据和库中的数据并不完全相同。因此,找到的数据为59.2
,但库中的数字为60
。我需要能够以这种方式匹配。 ismember
函数在这里不起作用。它应该更像是min(abs(lib-data))
。然后,我必须对每个匹配值(minval
)进行另一个操作。例如,对于每个Minval
,
if En < minVal - s
value = (En - (minVal-s)) / s
end
如果您可以帮助这种情况,我将非常感谢。
I am trying to write some code in Matlab(2016a).I have a 28x1
matrix library.I have data that I found as a result of the calculations I made. These are in the form of a 595x1
matrix. I want to match each data in the data with the data in the library and output the matching data to the screen. The number of columns is equal, but the number of rows is not.The data I found and the data in the library are not exactly the same. So the data found is 59.2
but the number in the library is 60
. I need to be able to match that way. The ismember
function didn't work here. It should be something more like min(abs(lib-data))
. Then I have to do another operation with each of the matching values (minVal
) I find. For example, for each minVal
,
if En < minVal - s
value = (En - (minVal-s)) / s
end
If you could help with this situation, I would greatly appreciate it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您的
数据
与某些lib
没有完全匹配,因此ismember
将无法使用。在这种情况下,使用最小差异如下。样本输出:
Since your
data
has no exact matching to somelib
, thenismember
will not work. Use minimum difference in this case as follows.Sample output: