MATLAB: Lagrange Interpolating Polynomials using Matlab

how to find the minimize of cost function using lagrange interpolating in matlabMATLABmatlab coder

Hello.,
Anybody here can help me to solve my I/O curve fitting using lagrange method. Here is below I attached several direction that I nedd to find. I also attached the script that I've do it before and my example curve fitting in PPT. Thank you
Best Regards,
Rizaldy

Best Answer

You must use a fitting tool, not an interpolation tool to solve your problem.
Apply "polyfit" with x-values = Generation Output [MW] and y-values = Fuel Cost [NT$/kWh] and n = 3.