タグ

2018年10月1日のブックマーク (2件)

  • Plane fit (z=ax+by+c) to 3D point data - MATLAB Answers - MATLAB Central

    I have step plot (attached) and I want to fit a plane on the lower terrace of it. Excel file of point cloud is attached as well. Data represent in file is N-by-3 numeric data and each column corresponds to x, y and z. Could anyone please help me out how to fit the plane to the lower terrace?

    Plane fit (z=ax+by+c) to 3D point data - MATLAB Answers - MATLAB Central
    dynamicsoar
    dynamicsoar 2018/10/01
    簡潔…!しかし [yourData(:,1:2), ones(N,1)] にすれば a=B(1), b=B(2), c=B(3) になってこっちの方が直感的なような(どっちでもいいが)
  • 最小二乗法に挑戦・一次関数編 - MATLABの本棚

    最小二乗法を使って直線近似をしてみます。簡単のために、今回は一次関数の形に近似する場合にしぼって解説します。 サンプルコードはこちら: clear close all % 生データの入力 x = [0 3 6 9 12 15 18]'; y = [31.9 35.5 37.1 40 41.9 44.6 47]'; % 生データをプロット plot(x, y, 'o') % 行列を作成 A = ones(7, 2); A(:, 1) = time; v = T; % 最小二乗法 u = A\v; % 近似直線のグラフを重ねてプロット x2 = 0:18; y2 = u(1) .* x + u(2); hold on plot(x2, y2)サンプルデータの説明 今回は長くなるので、覚悟して先を読んでください。(大急ぎで近似の結果だけほしい人は、polyfit関数を調べてみてください) 説明を

    最小二乗法に挑戦・一次関数編 - MATLABの本棚