Having trouble making a for loop equation

7 Ansichten (letzte 30 Tage)
Nina
Nina am 9 Jun. 2020
Beantwortet: David H am 9 Jun. 2020
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

Antworten (1)

David H
David H am 9 Jun. 2020
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

Kategorien

Mehr zu Polynomials finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by