Implement a function that calculates 1D Discrete Cosine Transform (DCT-II) for each row of a given input matrix so that the outputs are in columns.

For example:

Input:

[1 0 0 0]

Gives:

mydct([1 0 0 0])
ans =
          0.5
      0.65328
          0.5
       0.2706

Solution Stats

120 Solutions

21 Solvers

Last Solution submitted on Jan 20, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...