How to interpolate with a polynom in 3D?

10 ビュー (過去 30 日間)
Agustin Garzon
Agustin Garzon 2023 年 2 月 16 日
コメント済み: Agustin Garzon 2023 年 2 月 17 日
Hi all, I am working on a project and I need to obtain the polynom for a 3D table. Why? Because my idea is to use that polynom in Excel for calculus since I think it will be faster for iterations rathen than looking for values in a table, specially if the values are not in the table and an interpolation would be needed.
The table is in the images.
I found that with polyfit or polyfitn I could get the coefficients of a polynom. But I don't know how to insert the table in the Z.
Thank you very much,
Agustin.

回答 (1 件)

Cameron
Cameron 2023 年 2 月 16 日
Use interp2. Here's an example
x = 0.1:0.1:1; %sample x data
y = transpose(1:10); %sample y data
z = sin(x) - y.^x; %sample z data
interpX = 0.15; %your interpolated x value
interpY = 2.2; %your interpolated y value
interpZ = interp2(x,y,z,interpX,interpY); %interpolated value at that point
  5 件のコメント
Torsten
Torsten 2023 年 2 月 16 日
編集済み: Torsten 2023 年 2 月 16 日
Take a look at the example
"Fit a polynomial surface"
under
I don't know the quality of the fit you will obtain for your data, but I still would advice you to use 2d-interpolation as suggested.
Agustin Garzon
Agustin Garzon 2023 年 2 月 17 日
Thank you very much, I will try that.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by