我有 2 columns.Is 中滚珠轴承在 x 和 y 方向上的振动数据(g),有没有办法用这个数据和时间找到曼哈顿距离?

I have vibration data(g) in x and y direction for a Ball Bearing in 2 columns.Is there a way to find Manhattan distance just with this data & time?

我有滚珠轴承在 x 和 y 方向上的频率数据。以及另一列中的绝对时间。有没有办法只用频率和绝对时间找到曼哈顿距离..那么,谁能指导我?

For example the given file is like below

     3.54393190998923540E+9 -6.80819749832153320E-2 -1.33635997772216800E-2 
     3.54393190998923540E+9 -6.80819749832153320E-2 -1.33635997772216800E-2
     3.54393190998923540E+9 -6.80819749832153320E-2 -1.33635997772216800E-2
     3.54393190998923540E+9 -6.80819749832153320E-2 -1.33635997772216800E-2

这里,第一列是时间,第二列和第三列是x和y中的频率数据。我们如何在这里找到曼哈顿距离?

尝试

perl -i -pe 's/ /,/g;s/^/a$.=/' junk.txt 

您可以使用 dlmread 一次读取所有数据,然后分别访问每一列:

M = dlmread('datafile.txt');

dlmread 将找出分隔符并为您提供 M:

中正确的列数
M =

   3.5439e+09  -6.8082e-02  -1.3364e-02
   3.5439e+09  -6.8082e-02  -1.3364e-02
   3.5439e+09  -6.8082e-02  -1.3364e-02
   3.5439e+09  -6.8082e-02  -1.3364e-02

现在您可以访问第 2 列,例如,像这样:

>> M(:,2)
ans =

  -0.068082
  -0.068082
  -0.068082
  -0.068082