Can't use Polyfit on time vector (Getting error 'This Vector has the wrong number of Elements')
- December 9, 2020
- 2 replies
- 3898 views
The premise of this problem is I am using a spectrometer to collect data through a sample, and am trying to relate those values to data I am pulling off another measuring instrument (Called M1 here). I am using polyfit to generate a line of best fit through the data pulled from M1, and then trying to use that function on the time vector for the data collected from the spectrometer to relate the scope data to the M1 data (making it time independent)
The issue here is I am struggling to use polyfit the way I would like to. I want to use the function I generate from polyfit on a vector from an excel sheet, not a vector I have to generate myself in MathCAD. The reason for this being that if I have an error in data collection, the time vector for my spectrometer may be non-continuous.
I've attached a MathCAD sheet that hopefully clarifies the problem further. And if you're reading this, thanks!






