Current location - Training Enrollment Network - Mathematics courses - Calculation of Least Squares matlabe in the Tensile Experiment of Physical Water
Calculation of Least Squares matlabe in the Tensile Experiment of Physical Water
Basic algorithm steps of least square method in physical water stretching experiment;

1. Import data: store the experimental data in a two-dimensional array according to the order of independent variables and dependent variables, and then import them into Matlab.

2. Drawing scatter plot: Plot function is used to draw the experimental results into scatter plot, so as to observe the data distribution and trend.

3. Modeling: According to the experimental principle and hypothesis, the mathematical model between pinhole diameter and solution concentration is constructed, such as linear model and polynomial model.

4. Fitting data: Fit the data with the polyfit function, find the best fitting curve and model parameters, and output relevant statistical information, such as R squared value, standard deviation, etc.

5. Drawing fitting curve: According to the fitting model and parameters, using the polyval function to generate fitting curve, drawing it on the scatter plot, comparing the fitting effect and analyzing the trend.