04-16-2021 07:00 AM
Hi am trying to linear Fit a XY graph.
The inputs of the XY graph are the Y components of two waveforms. When the two waveforms are plotted against eachother i should see a linear fit, and i do (see picture).
I am trying to linear fit the XY graph by using the linear fit.vi. When doing so the output of the linear fit is an empty array (see probes). My input data into the linear are of the same length so i dont understand what i am doing wrong.
Solved! Go to Solution.
04-16-2021 07:07 AM
04-16-2021 07:20 AM
Are your X arrays and Y arrays the same length?
04-16-2021 07:28 AM
The error message i receive is
−20068 | Input parameters has at least one element that is Inf, NaN, DBL_MAX, or DBL_MIN |
The reason why i hadnt added the VI is because it is large, however i have added it to this message.
04-16-2021 07:29 AM
Yes they are both 1971 elements long
04-16-2021 11:43 AM
You're running your data through a normalize, then you normalize it to between 0 and 1 with some math, then run it through a log function before the linear fit.
This means that you're guaranteed at least one zero value pre-log, and ln(0) produces an illegal value, which is the cause of the error you stated.
04-19-2021 03:25 AM
Thank you this was actually a really easy solution. Should have been able to think of it myself.
Thank you for the help