How to generate this matrices in MATLAB

1 view (last 30 days)
Abdukerim Hasan
Abdukerim Hasan on 26 Oct 2020
Answered: Ameer Hamza on 26 Oct 2020

Answers (1)

Ameer Hamza
Ameer Hamza on 26 Oct 2020
You can use ndgrid() to generate i and j matrices
[i, j] = ndgrid(1:8)
and then simply use the formula
ti = pi/16 + (i-1)*pi/8;
C = cos((j-1).*ti)
Important thing is to use element-wise operator (.*).

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!