Skip to content

Instantly share code, notes, and snippets.

@Steboss
Created February 25, 2021 09:56
Show Gist options
  • Save Steboss/a5a0f77d25c5813d28ddbfa98b78166c to your computer and use it in GitHub Desktop.
Save Steboss/a5a0f77d25c5813d28ddbfa98b78166c to your computer and use it in GitHub Desktop.
Define the fitting lines values
for(int u=(fitting_order); u>-1;u--){
if(u==0){
//this is the last step
fitting_result+= tmpCoeff[u]; //here no tmpX[t] because we have 0 for x order so x^0=1
}
else{
//tmpCoeff * x^fitting_order - u
//e.g. tmpCoeff[0]*x --> fitting-Order = 1 and u = 0
fitting_result+=tmpCoeff[u]*(pow(scale_ax[t],u));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment