C program to calculate sum of diagonal elements of matrix

preview_player
Показать описание
In this video you will learn about what is the concept of diagonal elements of matrix. Then you will also learn how to add those elements by using a simple logic. Happy Learning !
Рекомендации по теме
Комментарии
Автор

I recommend you to download IDE which have black background, it helps your eyes and looks better in the video. Nice video btw

tomaskiss
Автор

Can you help me sort this out?Pleaseee
C is a matrix, the elements outside the diagonal are calculated by the 𝐶𝑖𝑗 relation, and the
elements on the diagonal are calculated by 𝐶𝑖𝑖. 𝑟𝑖

is a function expressing the location of the
sample points and is calculated by the given relation. Accordingly, prepare a script m.file that
calculates the elements of the C matrix with the number n that the user can enter from outside.
Display the results for n=20 on the command window.
𝐶𝑖𝑗 =
𝑀1(𝑟𝑖

)
(𝑟𝑖
∗−𝑟𝑗

)𝑀1(𝑟𝑗

)
for 𝑖 ≠ 𝑗 and 𝑖, 𝑗 = 1, 2, …, 𝑛
𝐶𝑖𝑖 = − ∑ 𝐶𝑖𝑗
𝑛
𝑗=1
𝑗≠𝑖
for 𝑖 = 1, 2, … ., 𝑛
where
𝑀1
(𝑟𝑖

) = ∏ (𝑟𝑖
∗ − 𝑟𝑗

)
𝑛
𝑗=1
𝑗≠𝑖
for 𝑖 = 1, 2, … ., 𝑛
𝑟𝑖
∗ =
1
2
[1 − cos
(𝑖−1)
(𝑛−1)
𝜋] for 𝑖 = 1, 2, … ., 𝑛

melisaltnok
visit shbcf.ru