0
私はMatlabで2ラインの幾何学的ポイントデータを持っています。私はポイントを介してスプラインを作る別のプログラムにそれらをエクスポートしています。例えばスプラインのランダムな点で温度を計算し、Matlabに送り返します。どのラインポイントが属しているかを見つける - 対応するソートマトリックス
今、私はこのデータを持っており、気温がどのラインに属しているのか分かりません。しかし、私は新しいポイントの座標を取得します。だから私はポイントが属している線を決定し、その情報を使って2つの温度ベクトルを分割する必要があります。
ここでは、使用する '例'を生成するコードを示します。
% Known geometric point data which is read by 3rd program.
x1 = 0:0.05:1; y1 = -sin(x1.*(4.*pi))./6;
x2 = 0:0.05:1; y2 = sin(x2.*(pi));
% 3rd program makes spline from given points.
xx1 = 0:0.075:1; xx2 = [0:0.1:1];
yy1 = spline(x1,y1,xx1);
yy2 = spline(x2,y2,xx2);
XY = [xx1, xx2; yy1, yy2];
[Y,I]=sort(XY(1,:));
% The program gives me DAT file with the 'new' coordinates of the new
% points. But the line-up of the points are random. In this example I've
% merged the coordinates of the two lines mixed them by sorting the X
% coordinates.
% The program gives me, for example, the temperature at these points in
% same order as the new coordinates. But now I'll need to know which line
% they belong to.
COORDINATE = XY(:,I);
TEMPERATURE = [COORDINATE(1,:); rand(1,length(COORDINATE))];
目標:
- [X1、Y1]または[X2、Y2]に属する座標のポイントを決定します。
- TEMPERATUREを[xx1; T1]および[xx2; T2]に対応する。
2本の線は互いに交差しないことに注意してください。しかし、それらは同じx間隔を持つ必要はありません。