2 simultaneous curve fits on the same plot
Mostra commenti meno recenti
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);
Risposte (1)
Sai Gudlur
il 13 Dic 2018
Categorie
Scopri di più su Get Started with Curve Fitting Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!