1、在VBA中输入Sub 姿态重复性()End Sub
2、变量的定义.Dim i As IntegerCells(1, 1).Value = "a轴坐标"Cells(1, 2).Value = &qu泠贾高框ot;b轴坐标"Cells(1, 3).Value = "c轴坐标"Cells(1, 4).Value = "a轴坐标平均值"Cells(1, 5).Value = "b轴坐标平均值"Cells(1, 6).Value = "c轴坐标平均值"Cells(1, 7).Value = "a轴姿态重复性"Cells(1, 8).Value = "a轴差方"Cells(1, 9).Value = "b轴差方"Cells(1, 10).Value = "c轴差方"Cells(3, 7).Value = "b轴姿态重复性"Cells(5, 7).Value = "c轴姿态重复性"Cells(5, 4).Value = "a轴差方和"Cells(7, 4).Value = "b轴差方和"Cells(9, 4).Value = "c轴差方和"Cells(2, 4) = 0Cells(2, 5) = 0Cells(2, 6) = 0Cells(6, 4) = 0Cells(8, 4) = 0Cells(10, 4) = 0
3、原始数据的上色标记.For j = 2 To 151 Step 5Cells(j + 4, 1).Interior.Color = RGB(0, 255, 0)Cells(j + 4, 2).Interior.Color = RGB(0, 255, 0)Cells(j + 4, 3).Interior.Color = RGB(0, 255, 0)Next
4、For j = 2 To 151 Step 5Cells(2, 4) = Cells(j + 4, 1) + Cells(2, 4) 'a轴求和NextCells(2, 4) = Cells(2, 4) / 30 'a轴平均值For j = 2 To 151 Step 5Cells(j + 4, 8) = (Cells(j + 4, 1) - Cells(2, 4)) ^ 2 'a轴差方NextFor j = 2 To 151 Step 5Cells(6, 4) = Cells(6, 4) + Cells(j + 4, 8) 'a轴差方和NextCells(2, 7) = (Cells(6, 4) / 29) ^ 0.5 'a轴姿态重复性
5、For j = 2 To 151 Step 5Cells(2, 5) = Cells(j + 4, 2) + Cells(2, 5) 'b轴求和NextCells(2, 5) = Cells(2, 5) / 30 'b轴平均值For j = 2 To 151 Step 5Cells(j + 4, 9) = (Cells(j + 4, 2) - Cells(2, 5)) ^ 2 'b轴差方NextFor j = 2 To 151 Step 5Cells(8, 4) = Cells(8, 4) + Cells(j + 4, 9) 'b轴差方和NextCells(4, 7) = (Cells(8, 4) / 29) ^ 0.5 'b轴姿态重复性
6、For j = 2 To 151 Step 5觊皱筠桡Cells(2, 6) = Cells(j + 4, 3) + Cells(2, 6) &垆杪屑丝#39;c轴求和NextCells(2, 6) = Cells(2, 6) / 30 'c轴平均值For j = 2 To 151 Step 5Cells(j + 4, 10) = (Cells(j + 4, 3) - Cells(2, 6)) ^ 2 'c轴差方NextFor j = 2 To 151 Step 5Cells(10, 4) = Cells(10, 4) + Cells(j + 4, 10) 'c轴差方和NextCells(6, 7) = (Cells(10, 4) / 29) ^ 0.5 'c轴姿态重复性