I have three spectrum, which essentially shares the same wavelength (x-axis). I would like to add the first two spectrum (i.e. column y1 & y2) is such a way as describes below to match the 3rd spectrum:
Ideally: y3 = a*y1 + b*y2
But in reality, I would like to find coefficients a & b with minimised y3 - (a*y1 + b*y2)
All x-axis, y1, y2, and y3 are columns of 608X1
The problem I am facing is that I don't know how to optimise the coefficients a & b to achive what I want.
Thank you !