2 simultaneous curve fits on the same plot
Afficher commentaires plus anciens
Hello Everyone,
The motive of this code is to find delta of the Angle (Y-Axis). On the X- Axis the Torque Ranges from -x to +x. I want to fit two curve fit lines one when Torque >=0 and other one Torque<=0 on the same plot. Could someone help? I have attached my code and also the figure with lines how i intend to have my figure. Any suggestion or help is appreciated.
Thanks
Anand
[filename,pathname] = uigetfile('*.txt');
fullfilename = fullfile(pathname,filename);
A = importdata(fullfilename);
Torque=A(:,1);
Angle=A(:,2);
xmin=min(Torque);
xmax=max(Torque);
ymin=min(Angle);
ymax=max(Angle);
yavg=mean(Angle);
xavg=xmax;
id = (Torque >= 0);
Torque_Positive = Torque(id);
Angle_Positive = Angle(id);
it = (Torque <=0);
Torque_Negative = Torque(it);
Angle_Negative = Torque(it);
T1 = table(Torque_Positive,Angle_Positive);
T2 = table(Torque_Negative,Angle_Negative);
Réponses (1)
Sai Gudlur
le 13 Déc 2018
Catégories
En savoir plus sur Get Started with Curve Fitting Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!