离散正弦变换MATRIX

时间:2018-04-05 13:42:48

标签: matlab image-processing signal-processing

我编写了一个脚本,它提供了离散正弦变换(DST)矩阵。但是,它为第一行返回零。虽然第一行不应该为零。

i

它返回:

Sub Button1_Click()

'Step 1: Copy Range
Range("D2:E2").Copy

'Step 2: Move to row after last with formula in column D
Range("D" & Cells.Rows.Count).End(xlUp).Select
ActiveCell.Offset(1).Select
ActiveSheet.Cells(ActiveCell.Row, 1).Select

'Step 2: Paste formula
Call Paste_formula

'Step 3: Refresh Pivot table
ActiveWorkbook.RefreshAll

'Step 4: Save Workbook
ActiveWorkbook.Save

End Sub


Sub Paste_formula()

'Declare variables and set their types
Dim r As Range
Dim CurrRow As Long
Dim LastRow As Long

'Execute a series of statements in the 'Data' Worksheet
With Sheets("Data")
    'Set variable's values
    CurrRow = ActiveCell.Row
    LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row

    'For Loop which establishes the range for r being between the last row with Data in column D and the last row with Data in column A
    For Each r In .Range(CurrRow, LastRow)
        'In every row there is a remuneration data in column A
        If r.Value <> "" Then
        ' ...select the respective cell in column D...
            r.Offset(0, 4).Select
            ' ...and paste the current selection
            ActiveSheet.Paste
        End If
    Next r
End With

End Sub

1 个答案:

答案 0 :(得分:-1)

零的正弦为零

sin(0) == 0

因此,DST变换矩阵的第一行全为零。