0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

エクセル線形補完備忘録

Last updated at Posted at 2021-09-20

備忘録 キーワード SOC,Li-ion,線形補完

Sub hokan()

Dim i, k, v, count As Long
s = Range("E6:O7").Value

For i = 1 To 11
Cells(1, i).Value = s(2, i)
Next i

Dim Delta, Delta1, Delta_y, Delta_y1
Dim x() As Integer
Dim z(10000, 10000) As String
z(1, 1) = s(1, 1)
z(2, 1) = s(2, 1)
count = 1


For v = 1 To 4
    Delta = (s(1, 2) - s(1, 1)) / 4
    Delta1 = s(1, 1) + Delta * v
    z(1, v + 1) = Delta1
    Delta_y = (s(2, 2) - s(2, 1)) / 4
    Delta_y1 = s(2, 1) + Delta_y * v
    z(2, v + 1) = Delta_y1
    
Next v
For k = 2 To 10
    For v = 1 To 4
    Delta = (s(1, k + 1) - s(1, k)) / 4
    Delta1 = s(1, k) + Delta * v
    z(1, v + count * 4) = Delta1
    Delta_y = (s(2, k + 1) - s(2, k)) / 4
    Delta_y1 = s(2, k) + Delta_y * v
    z(2, v + count * 4) = Delta_y1
    Next v
    count = count + 1
Next k

For i = 1 To 50
Cells(2, i).Value = z(1, i)
Cells(3, i).Value = z(2, i)
Next i

End Sub

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?