2nd degree fit with x^2 unknown
Show older comments
Hi, i want to make a curv fit to this eq: t=r^2*x^2+t(1) where r and t are known and vectors ( r=[0 2.1 4.2 6.3 8.4 10.5 12.6 ]
t =[93.3168 0 91.1868 0 93.0526 91.9160 88.0559] ) and then get x. I also want to exclude the values where t=0 and their corresponding r. Anyone that knows how to? Ive been searching forever but all functions asunme that i plug in x and y and want the coefficients but thats not the case here!
Thanks allot!!
Answers (1)
bym
on 22 Jul 2011
If r & t are known, you can solve for x - no curve fitting required
clc;clear
t = [93.3168 0 91.1868 0 93.0526 91.9160 88.0559];
r = [0 2.1 4.2 6.3 8.4 10.5 12.6 ];
r = r(t~=0); %discard r where t = 0
t = t(t~=0); %discard t = 0
x = sqrt((t-t(1))./r.^2)
1 Comment
emelie Flood
on 23 Jul 2011
Categories
Find more on Get Started with Curve Fitting Toolbox 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!