getting a approximation of a linear slope line of a curved set of data points
4 views (last 30 days)
Show older comments
I am trying to plot a linear slope line for the area of the first illustration that rises. This is to get a approximation of the slope, although it has a slight curve I need this slope for an engineering calculation. I can't get theischange command to work for this and I don't know if at the start of the data a bunch of 0's are recorded. I can't eliminate these because it changes other graphs for this experiment. If you look at the second picture you'll understand what I trying to do. I have included my code at the end.
clc
clear
F=[0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.0100000000000000
0.0100000000000000
0.0100000000000000
0.0100000000000000
0.0100000000000000
0.0100000000000000
0.0100000000000000
0.0100000000000000
0.0100000000000000
0.0100000000000000
0.0100000000000000
0.0100000000000000
0.0200000000000000
0.0200000000000000
0.0200000000000000
0.0200000000000000
0.0200000000000000
0.0300000000000000
0.0300000000000000
0.0300000000000000
0.0400000000000000
0.0400000000000000
0.0400000000000000
0.0400000000000000
0.0400000000000000
0.0500000000000000
0.0500000000000000
0.0500000000000000
0.0600000000000000
0.0700000000000000
0.0800000000000000
0.0900000000000000
0.100000000000000
0.130000000000000
0.170000000000000
0.200000000000000
0.240000000000000
0.280000000000000
0.330000000000000
0.430000000000000
0.490000000000000
0.530000000000000
0.580000000000000
0.660000000000000
0.810000000000000
0.890000000000000
0.970000000000000
1.04000000000000
1.15000000000000
1.25000000000000
1.32000000000000
1.39000000000000
1.48000000000000
1.63000000000000
1.68000000000000
1.74000000000000
1.84000000000000
1.99000000000000
2.08000000000000
2.18000000000000
2.25000000000000
2.33000000000000
2.55000000000000
2.63000000000000
2.72000000000000
2.80000000000000
2.88000000000000
2.98000000000000
3.07000000000000
3.17000000000000
3.24000000000000
3.43000000000000
3.52000000000000
3.59000000000000
3.64000000000000
3.70000000000000
3.87000000000000
3.92000000000000
3.96000000000000
4.02000000000000
4.10000000000000
4.24000000000000
4.31000000000000
4.38000000000000
4.47000000000000
4.62000000000000
4.68000000000000
4.77000000000000
4.84000000000000
4.91000000000000
5.03000000000000
5.13000000000000
5.22000000000000
5.28000000000000
5.42000000000000
5.51000000000000
5.58000000000000
5.66000000000000
5.73000000000000
5.90000000000000
5.96000000000000
6.02000000000000
6.10000000000000
6.23000000000000
6.28000000000000
6.36000000000000
6.44000000000000
6.50000000000000
6.62000000000000
6.70000000000000
6.78000000000000
6.84000000000000
7.02000000000000
7.08000000000000
7.12000000000000
7.17000000000000
7.24000000000000
7.37000000000000
7.42000000000000
7.49000000000000
7.54000000000000
7.61000000000000
7.70000000000000
7.76000000000000
7.82000000000000
7.90000000000000
8.04000000000000
8.10000000000000
8.18000000000000
8.21000000000000
8.26000000000000
8.39000000000000
8.46000000000000
8.50000000000000
8.54000000000000
8.62000000000000
8.72000000000000
8.74000000000000
8.78000000000000
8.84000000000000
8.92000000000000
8.96000000000000
9.01000000000000
9.06000000000000
9.10000000000000
9.15000000000000
9.20000000000000
9.26000000000000
9.29000000000000
9.38000000000000
9.42000000000000
9.45000000000000
9.49000000000000
9.53000000000000
9.60000000000000
9.64000000000000
9.68000000000000
9.71000000000000
9.72000000000000
9.78000000000000
9.82000000000000
9.84000000000000
9.87000000000000
9.90000000000000
9.94000000000000
9.95000000000000
9.98000000000000
9.99000000000000
10.0400000000000
10.0400000000000
10.0600000000000
10.0800000000000
10.0900000000000
10.1100000000000
10.1100000000000
10.1200000000000
10.1200000000000
10.1400000000000
10.1600000000000
10.1700000000000
10.1700000000000
10.1700000000000
10.1900000000000
10.2000000000000
10.2000000000000
10.2000000000000
10.2100000000000
10.2100000000000
10.2400000000000
10.2400000000000
10.2400000000000
10.2500000000000
10.2500000000000
10.2500000000000
10.2600000000000
10.2600000000000
10.2700000000000
10.2800000000000
10.2800000000000
10.2900000000000
10.3000000000000
10.3100000000000
10.3100000000000
10.3100000000000
10.3100000000000
10.3200000000000
10.3300000000000
10.3300000000000
10.3300000000000
10.3500000000000
10.3500000000000
10.3500000000000
10.3600000000000
10.3800000000000
10.3800000000000
10.3800000000000
10.3800000000000
10.3800000000000
10.3800000000000
10.4000000000000
10.4000000000000
10.4000000000000
10.4000000000000
10.4100000000000
10.4100000000000
10.4200000000000
10.4200000000000
10.4300000000000
10.4500000000000
10.4500000000000
10.4500000000000
10.4500000000000
10.4500000000000
10.4600000000000
10.4600000000000
10.4600000000000
10.4600000000000
10.4800000000000
10.4800000000000
10.4900000000000
10.4900000000000
10.4900000000000
10.4900000000000
10.5100000000000
10.5100000000000
10.5100000000000
10.5100000000000
10.5100000000000
10.5200000000000
10.5200000000000
10.5200000000000
10.5400000000000
10.5400000000000
10.5400000000000
10.5400000000000
10.5500000000000
10.5600000000000
10.5600000000000
10.5700000000000
10.5700000000000
10.5700000000000
10.5800000000000
10.5900000000000
10.5900000000000
10.5900000000000
10.5900000000000
10.5900000000000
10.6000000000000
10.6000000000000
10.6100000000000
10.6100000000000
10.6100000000000
10.6100000000000
10.6100000000000
10.6100000000000
10.6200000000000
10.6300000000000
10.6300000000000
10.6300000000000
10.6400000000000
10.6400000000000
10.6400000000000
10.6400000000000
10.6400000000000
10.6500000000000
10.6500000000000
10.6700000000000
10.6700000000000
10.6700000000000
10.6700000000000
10.6700000000000
10.6800000000000
10.6800000000000
10.6800000000000
10.6900000000000
10.6900000000000
10.6900000000000
10.6900000000000
10.7000000000000
10.7000000000000
10.7000000000000
10.7000000000000
10.7000000000000
10.7000000000000
10.7000000000000
10.7100000000000
10.7100000000000
10.7200000000000
10.7200000000000
10.7200000000000
10.7200000000000
10.7200000000000
10.7400000000000
10.7400000000000
10.7400000000000
10.7400000000000
10.7400000000000
10.7400000000000
10.7600000000000
10.7600000000000
10.7600000000000
10.7600000000000
10.7600000000000
10.7600000000000
10.7700000000000
10.7800000000000
10.7800000000000
10.7800000000000
10.7800000000000
10.7800000000000
10.7800000000000
10.7800000000000
10.7800000000000
10.7900000000000
10.7900000000000
10.7900000000000
10.7900000000000
10.7900000000000
10.7900000000000
10.8200000000000
10.8200000000000
10.8200000000000
10.8200000000000
10.8200000000000
10.8200000000000
10.8200000000000
10.8200000000000
10.8200000000000
10.8200000000000
10.8200000000000
10.8200000000000
10.8200000000000
10.8200000000000
10.8500000000000
10.8500000000000
10.8500000000000
10.8500000000000
10.8500000000000
10.8500000000000
10.8500000000000
10.8500000000000
10.8500000000000
10.8500000000000
10.8600000000000
10.8700000000000
10.8700000000000
10.8700000000000
10.8700000000000
10.8700000000000
10.8700000000000
10.8700000000000
10.8800000000000
10.8800000000000
10.8900000000000
10.8900000000000
10.8900000000000
10.8900000000000
10.8900000000000
10.8900000000000
10.8900000000000
10.8900000000000
10.8900000000000
10.8900000000000
10.9000000000000
10.9000000000000
10.9000000000000
10.9000000000000
10.9000000000000
10.9000000000000
10.9000000000000
10.9100000000000
10.9100000000000
10.9100000000000
10.9100000000000
10.9100000000000
10.9100000000000
10.9100000000000
10.9100000000000
10.9100000000000
10.9100000000000
10.9100000000000
10.9200000000000
10.9300000000000
10.9300000000000
10.9300000000000
10.9300000000000
10.9300000000000
10.9300000000000
10.9400000000000
10.9400000000000
10.9400000000000
10.9400000000000
10.9400000000000
10.9600000000000
10.9700000000000
10.9700000000000
10.9700000000000
10.9700000000000
10.9700000000000
10.9700000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9800000000000
10.9900000000000
10.9900000000000
10.9900000000000
10.9900000000000
10.9900000000000
10.9900000000000
10.9900000000000
10.9900000000000
10.9900000000000
10.9900000000000
10.9900000000000
10.9900000000000
11
11
11
11
11.0100000000000
11.0100000000000
11.0100000000000
11.0100000000000
11.0100000000000
11.0100000000000
11.0100000000000
11.0100000000000
11.0100000000000
11.0100000000000
11.0200000000000
11.0200000000000
11.0200000000000
11.0200000000000
11.0200000000000
11.0200000000000
11.0400000000000
11.0400000000000
11.0400000000000
11.0400000000000
11.0400000000000
11.0400000000000
11.0400000000000
11.0400000000000
11.0400000000000
11.0400000000000
11.0400000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0500000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000
11.0700000000000];
DeltaL=[0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-0.0100000000000000
-0.0300000000000000
-0.0500000000000000
-0.0600000000000000
-0.0700000000000000
-0.0800000000000000
-0.0900000000000000
-0.110000000000000
-0.120000000000000
-0.130000000000000
-0.140000000000000
-0.150000000000000
-0.160000000000000
-0.180000000000000
-0.190000000000000
-0.200000000000000
-0.220000000000000
-0.230000000000000
-0.240000000000000
-0.260000000000000
-0.260000000000000
-0.280000000000000
-0.290000000000000
-0.310000000000000
-0.320000000000000
-0.330000000000000
-0.340000000000000
-0.350000000000000
-0.360000000000000
-0.370000000000000
-0.380000000000000
-0.400000000000000
-0.410000000000000
-0.420000000000000
-0.430000000000000
-0.460000000000000
-0.480000000000000
-0.490000000000000
-0.510000000000000
-0.530000000000000
-0.540000000000000
-0.560000000000000
-0.570000000000000
-0.580000000000000
-0.600000000000000
-0.620000000000000
-0.630000000000000
-0.650000000000000
-0.660000000000000
-0.670000000000000
-0.680000000000000
-0.690000000000000
-0.700000000000000
-0.710000000000000
-0.720000000000000
-0.740000000000000
-0.740000000000000
-0.750000000000000
-0.760000000000000
-0.770000000000000
-0.780000000000000
-0.790000000000000
-0.800000000000000
-0.810000000000000
-0.830000000000000
-0.840000000000000
-0.850000000000000
-0.860000000000000
-0.860000000000000
-0.870000000000000
-0.880000000000000
-0.890000000000000
-0.910000000000000
-0.910000000000000
-0.930000000000000
-0.940000000000000
-0.950000000000000
-0.950000000000000
-0.960000000000000
-0.970000000000000
-0.980000000000000
-0.980000000000000
-0.990000000000000
-1
-1.01000000000000
-1.02000000000000
-1.02000000000000
-1.04000000000000
-1.04000000000000
-1.05000000000000
-1.06000000000000
-1.07000000000000
-1.08000000000000
-1.09000000000000
-1.10000000000000
-1.11000000000000
-1.12000000000000
-1.13000000000000
-1.14000000000000
-1.15000000000000
-1.16000000000000
-1.17000000000000
-1.18000000000000
-1.19000000000000
-1.20000000000000
-1.21000000000000
-1.22000000000000
-1.23000000000000
-1.24000000000000
-1.25000000000000
-1.25000000000000
-1.27000000000000
-1.28000000000000
-1.29000000000000
-1.30000000000000
-1.31000000000000
-1.32000000000000
-1.33000000000000
-1.34000000000000
-1.34000000000000
-1.36000000000000
-1.37000000000000
-1.37000000000000
-1.39000000000000
-1.39000000000000
-1.40000000000000
-1.41000000000000
-1.42000000000000
-1.43000000000000
-1.44000000000000
-1.45000000000000
-1.46000000000000
-1.46000000000000
-1.48000000000000
-1.48000000000000
-1.50000000000000
-1.51000000000000
-1.51000000000000
-1.53000000000000
-1.53000000000000
-1.54000000000000
-1.55000000000000
-1.57000000000000
-1.57000000000000
-1.58000000000000
-1.59000000000000
-1.61000000000000
-1.61000000000000
-1.62000000000000
-1.63000000000000
-1.64000000000000
-1.65000000000000
-1.67000000000000
-1.68000000000000
-1.69000000000000
-1.70000000000000
-1.71000000000000
-1.72000000000000
-1.74000000000000
-1.75000000000000
-1.76000000000000
-1.77000000000000
-1.79000000000000
-1.80000000000000
-1.81000000000000
-1.83000000000000
-1.84000000000000
-1.85000000000000
-1.86000000000000
-1.87000000000000
-1.89000000000000
-1.90000000000000
-1.92000000000000
-1.93000000000000
-1.95000000000000
-1.97000000000000
-1.98000000000000
-1.99000000000000
-2.01000000000000
-2.02000000000000
-2.03000000000000
-2.05000000000000
-2.06000000000000
-2.07000000000000
-2.08000000000000
-2.10000000000000
-2.11000000000000
-2.13000000000000
-2.14000000000000
-2.15000000000000
-2.16000000000000
-2.18000000000000
-2.19000000000000
-2.21000000000000
-2.22000000000000
-2.23000000000000
-2.24000000000000
-2.26000000000000
-2.26000000000000
-2.28000000000000
-2.29000000000000
-2.30000000000000
-2.31000000000000
-2.33000000000000
-2.35000000000000
-2.36000000000000
-2.37000000000000
-2.38000000000000
-2.40000000000000
-2.41000000000000
-2.43000000000000
-2.44000000000000
-2.46000000000000
-2.46000000000000
-2.47000000000000
-2.49000000000000
-2.50000000000000
-2.52000000000000
-2.54000000000000
-2.54000000000000
-2.55000000000000
-2.57000000000000
-2.58000000000000
-2.60000000000000
-2.61000000000000
-2.62000000000000
-2.63000000000000
-2.64000000000000
-2.66000000000000
-2.67000000000000
-2.69000000000000
-2.70000000000000
-2.70000000000000
-2.72000000000000
-2.73000000000000
-2.74000000000000
-2.75000000000000
-2.77000000000000
-2.78000000000000
-2.79000000000000
-2.81000000000000
-2.82000000000000
-2.83000000000000
-2.85000000000000
-2.86000000000000
-2.87000000000000
-2.88000000000000
-2.90000000000000
-2.91000000000000
-2.93000000000000
-2.94000000000000
-2.95000000000000
-2.96000000000000
-2.98000000000000
-2.99000000000000
-3.01000000000000
-3.01000000000000
-3.03000000000000
-3.04000000000000
-3.06000000000000
-3.07000000000000
-3.08000000000000
-3.09000000000000
-3.10000000000000
-3.11000000000000
-3.13000000000000
-3.14000000000000
-3.15000000000000
-3.17000000000000
-3.18000000000000
-3.18000000000000
-3.20000000000000
-3.21000000000000
-3.22000000000000
-3.24000000000000
-3.25000000000000
-3.26000000000000
-3.27000000000000
-3.28000000000000
-3.29000000000000
-3.30000000000000
-3.32000000000000
-3.33000000000000
-3.34000000000000
-3.35000000000000
-3.35000000000000
-3.36000000000000
-3.37000000000000
-3.39000000000000
-3.40000000000000
-3.40000000000000
-3.41000000000000
-3.42000000000000
-3.42000000000000
-3.44000000000000
-3.45000000000000
-3.46000000000000
-3.48000000000000
-3.49000000000000
-3.50000000000000
-3.51000000000000
-3.52000000000000
-3.54000000000000
-3.56000000000000
-3.56000000000000
-3.58000000000000
-3.58000000000000
-3.59000000000000
-3.61000000000000
-3.62000000000000
-3.63000000000000
-3.65000000000000
-3.65000000000000
-3.66000000000000
-3.68000000000000
-3.69000000000000
-3.70000000000000
-3.72000000000000
-3.73000000000000
-3.73000000000000
-3.75000000000000
-3.76000000000000
-3.77000000000000
-3.78000000000000
-3.80000000000000
-3.80000000000000
-3.82000000000000
-3.84000000000000
-3.85000000000000
-3.88000000000000
-3.88000000000000
-3.89000000000000
-3.91000000000000
-3.92000000000000
-3.93000000000000
-3.95000000000000
-3.96000000000000
-3.97000000000000
-3.98000000000000
-4
-4.01000000000000
-4.02000000000000
-4.04000000000000
-4.05000000000000
-4.06000000000000
-4.08000000000000
-4.09000000000000
-4.09000000000000
-4.11000000000000
-4.13000000000000
-4.13000000000000
-4.14000000000000
-4.15000000000000
-4.16000000000000
-4.17000000000000
-4.18000000000000
-4.19000000000000
-4.20000000000000
-4.21000000000000
-4.22000000000000
-4.23000000000000
-4.24000000000000
-4.26000000000000
-4.27000000000000
-4.28000000000000
-4.29000000000000
-4.30000000000000
-4.32000000000000
-4.33000000000000
-4.34000000000000
-4.36000000000000
-4.36000000000000
-4.37000000000000
-4.39000000000000
-4.40000000000000
-4.42000000000000
-4.43000000000000
-4.44000000000000
-4.46000000000000
-4.47000000000000
-4.47000000000000
-4.49000000000000
-4.50000000000000
-4.52000000000000
-4.53000000000000
-4.54000000000000
-4.56000000000000
-4.57000000000000
-4.59000000000000
-4.60000000000000
-4.61000000000000
-4.62000000000000
-4.64000000000000
-4.65000000000000
-4.67000000000000
-4.68000000000000
-4.69000000000000
-4.71000000000000
-4.72000000000000
-4.73000000000000
-4.75000000000000
-4.76000000000000
-4.76000000000000
-4.78000000000000
-4.79000000000000
-4.80000000000000
-4.82000000000000
-4.84000000000000
-4.84000000000000
-4.85000000000000
-4.87000000000000
-4.88000000000000
-4.90000000000000
-4.91000000000000
-4.92000000000000
-4.93000000000000
-4.95000000000000
-4.97000000000000
-4.98000000000000
-4.99000000000000
-5
-5.01000000000000
-5.03000000000000
-5.04000000000000
-5.06000000000000
-5.07000000000000
-5.08000000000000
-5.09000000000000
-5.10000000000000
-5.11000000000000
-5.13000000000000
-5.15000000000000
-5.16000000000000
-5.17000000000000
-5.19000000000000
-5.20000000000000
-5.22000000000000
-5.24000000000000
-5.24000000000000
-5.26000000000000
-5.28000000000000
-5.29000000000000
-5.31000000000000
-5.32000000000000
-5.33000000000000
-5.36000000000000
-5.38000000000000
-5.39000000000000
-5.41000000000000
-5.42000000000000
-5.44000000000000
-5.46000000000000
-5.47000000000000
-5.49000000000000
-5.51000000000000
-5.52000000000000
-5.54000000000000
-5.55000000000000
-5.57000000000000
-5.57000000000000
-5.59000000000000
-5.60000000000000
-5.61000000000000
-5.64000000000000
-5.65000000000000
-5.65000000000000
-5.67000000000000
-5.69000000000000
-5.71000000000000
-5.72000000000000
-5.73000000000000
-5.75000000000000
-5.76000000000000
-5.79000000000000
-5.79000000000000
-5.80000000000000
-5.82000000000000
-5.83000000000000
-5.85000000000000
-5.86000000000000
-5.87000000000000
-5.88000000000000
-5.90000000000000
-5.91000000000000
-5.93000000000000
-5.95000000000000
-5.95000000000000
-5.97000000000000
-5.99000000000000
-6
-6.02000000000000
-6.03000000000000
-6.04000000000000
-6.05000000000000
-6.07000000000000
-6.08000000000000
-6.10000000000000
-6.11000000000000
-6.12000000000000
-6.14000000000000
-6.16000000000000
-6.17000000000000
-6.18000000000000
-6.19000000000000
-6.20000000000000
-6.23000000000000
-6.24000000000000
-6.25000000000000
-6.26000000000000
-6.27000000000000
-6.28000000000000
-6.30000000000000
-6.31000000000000
-6.32000000000000
-6.34000000000000
-6.36000000000000
-6.36000000000000
-6.38000000000000
-6.40000000000000
-6.41000000000000
-6.43000000000000
-6.44000000000000
-6.45000000000000
-6.47000000000000
-6.49000000000000
-6.51000000000000
-6.52000000000000
-6.53000000000000
-6.55000000000000
-6.57000000000000
-6.58000000000000
-6.60000000000000
-6.61000000000000
-6.62000000000000
-6.65000000000000
-6.66000000000000
-6.67000000000000
-6.69000000000000
-6.70000000000000
-6.71000000000000
-6.73000000000000
-6.74000000000000
-6.76000000000000
-6.78000000000000
-6.80000000000000
-6.81000000000000
-6.84000000000000
-6.85000000000000
-6.86000000000000
-6.88000000000000
-6.89000000000000
-6.89000000000000
-6.91000000000000
-6.92000000000000
-6.92000000000000
-6.95000000000000
-6.96000000000000
-6.97000000000000
-6.99000000000000
-7
-7.01000000000000
-7.02000000000000
-7.04000000000000
-7.05000000000000
-7.06000000000000
-7.07000000000000
-7.08000000000000
-7.09000000000000
-7.11000000000000
-7.12000000000000
-7.14000000000000
-7.15000000000000
-7.16000000000000
-7.17000000000000
-7.18000000000000
-7.19000000000000
-7.21000000000000
-7.22000000000000
-7.24000000000000
-7.25000000000000
-7.26000000000000
-7.28000000000000
-7.29000000000000
-7.30000000000000
-7.32000000000000
-7.32000000000000
-7.34000000000000
-7.36000000000000
-7.36000000000000
-7.38000000000000
-7.40000000000000
-7.41000000000000
-7.42000000000000
-7.44000000000000
-7.45000000000000
-7.48000000000000
-7.48000000000000
-7.49000000000000
-7.50000000000000
-7.52000000000000
-7.54000000000000
-7.55000000000000
-7.56000000000000
-7.58000000000000
-7.59000000000000
-7.60000000000000
-7.62000000000000
-7.63000000000000
-7.64000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000
-8.11000000000000];
di=5.05;
df=4.31;
Ao=(pi*di^2)/4;
Af=(pi*df^2)/4;
L=58.98;
Strain=abs(DeltaL)/L;
Stress=F/Ao;
plot(Strain,Stress,Marker=".")
xlabel('\epsilon (mm/mm)')
ylabel('\sigma (MPa')
title('Stress Strain Curve of Member in Tension')
[Lv,m,b] = ischange(Strain, 'linear', 'Threshold',0.01); % Change Points
Chs=nnz(Lv)
idxv = 1:find(Lv);
mdl=fitlm(Strain(idxv), Stress(idxv))
Slope = mdl.Coefficients.Estimate(2)
RSq = mdl.Rsquared.Ordinary
RSqAdj = mdl.Rsquared.Adjusted
[y,yci] = predict(mdl, Strain(idxv));
figure
plot(Strain,Stress,Marker=".")
xlabel('\epsilon (rad)')
ylabel('\sigma (Pa)')
title('Stress Strain Curve')
hold on
plot(Strain(Lv),Stress(Lv),"r+")
plot(Strain(idxv), y, '-r')
plot(Strain(idxv), yci, '--r')
hold off
0 Comments
Accepted Answer
Image Analyst
on 3 Aug 2023
Try this:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
% Load data from mat file.
s = load('jon.mat')
F = s.F;
DeltaL = s.DeltaL;
%--------------------------------------------------------------------------
% Assign some parameters.
di=5.05;
df=4.31;
Ao=(pi*di^2)/4;
Af=(pi*df^2)/4;
L=58.98;
%--------------------------------------------------------------------------
% Compute Strain and Stress
Strain = abs(DeltaL) / L;
Stress = F / Ao;
%--------------------------------------------------------------------------
% Plot original data.
hFig1 = figure;
plot(Strain, Stress, Marker=".")
xlabel('\epsilon (mm/mm)')
ylabel('\sigma (MPa)')
title('Stress Strain Curve of Member in Tension')
grid on;
fontsize(25, 'Points');
hFig1.WindowState = 'maximized';
%--------------------------------------------------------------------------
% Jon's way.
[Lv,m,b] = ischange(Strain, 'linear', 'Threshold',0.01); % Change Points
Chs=nnz(Lv);
idexesToFit = 1:find(Lv);
%--------------------------------------------------------------------------
% Image Analyst's way.
% Fit between 0.05 and 0.45.
index1 = find(Stress > 0.05, 1, 'first')
index2 = find(Stress > 0.45, 1, 'first')
idexesToFit = index1 : index2;
% Indicate range where we're going to fit with colored vertical lines.
xline(Strain(index1), 'Color', 'm', 'LineWidth', 2);
xline(Strain(index2), 'Color', 'm', 'LineWidth', 2);
grid on;
%--------------------------------------------------------------------------
% Fit the data to a linear model.
mdl = fitlm(Strain(idexesToFit), Stress(idexesToFit))
Slope = mdl.Coefficients.Estimate(2)
RSq = mdl.Rsquared.Ordinary
RSqAdj = mdl.Rsquared.Adjusted
[y, yci] = predict(mdl, Strain(idexesToFit));
%--------------------------------------------------------------------------
% Plot the fit over the original data.
hFig2 = figure;
plot(Strain, Stress, Marker=".") % Plot original data.
grid on;
hFig2.WindowState = 'maximized';
xlabel('\epsilon (rad)')
ylabel('\sigma (Pa)')
title('Stress Strain Curve')
hold on
plot(Strain(idexesToFit), Stress(idexesToFit),"r+")
plot(Strain(idexesToFit), y, '-r')
plot(Strain(idexesToFit), yci, '--r')
% Plot fit range.
xline(Strain(index1), 'Color', 'm', 'LineWidth', 2);
xline(Strain(index2), 'Color', 'm', 'LineWidth', 2);
hold off
fontsize(25, 'Points');
0 Comments
More Answers (0)
See Also
Categories
Find more on Stress and Strain 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!