Having trouble making a for loop equation

1 回表示 (過去 30 日間)
Nina
Nina 2020 年 6 月 9 日
回答済み: David H 2020 年 6 月 9 日
I am trying to make a for loop that would help me generate a polyfit to a data I have:
>> polyfit(T(x,y,z),z/30,8)
x goes up to 240
y goes up to 320
z goes up to 1500
  1 件のコメント
KSSV
KSSV 2020 年 6 月 9 日
What trouble you have?

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

回答 (1 件)

David H
David H 2020 年 6 月 9 日
It isn't obvious what you are trying to do, you have a 3D function and want to fit an order 8 polynomial to it in z only?
  1. In case you want to fit a 240 by 320 array of polynomials for every single slice through that array, loop over the x and y positions
  2. In case you want to fit a 3 D polynomial you might want to look at https://www.mathworks.com/matlabcentral/fileexchange/34765-polyfitn

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by