3rd order approximation solving for variable
Show older comments
I am using a 3rd order approximation to solve the equation shown below:with the x values representing input voltages and y values representing measured output voltages.I need asistance in solving for Vin with Vo given as .956V
Vo = Co + C1*Vin +C2*Vin^2+C3*Vin^3
I solved for Co,C1,C2,and C3 with the following Matlab code
x = (0.2:0.2:0.8);
y = [.3168, .7404, 1.3736, 2.2692];
p = polyfit(x,y,3)
This code gave me the following values which I know are correct.
Co =1.1
C1 = 1.3
C2 = 1.03
C3 = 0.05
I tried to solve for Vin using the following code but it does not give me the correct answer since the Vin is supposed to be Vin = 0.475
equation = [0.05 1.03 1.3 1.1 -.956];
roots(equation)
I do not get Vin = .475 with the previous code and this code gives me 4 different answers for Vin . The original problem statement is shown below. I need assistance in creating the code to solve for Vin. Thanks you in advance!

Accepted Answer
More Answers (0)
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!