Double Sigma with an equation
3 次查看(过去 30 天)
显示 更早的评论
Hello people, I am very new to Matlab and got stuck to a question;
The coefficients in the matrix will be used in the equation. How can I use the code and get the answer for the eqn?
1 个评论
回答(2 个)
Prasanna Gude
2020-3-12
The equation can be solved with the help of ‘for’loop and ‘sum’ function in MATLAB. The following code will solve the equation:
for j = 1:5
for i = 1:5
X(5) = x(i,j)+x(j,i)-(x(i,i)^2);
end
sum1(5) = sum(X);
end
SUM = sum(sum1);
When you are doing both the summations from 1 to 5, the matrix ‘x’ must be of size 5x5 or above.
0 个评论
Paola Carranza Bravo
2021-9-7
for j = 1:5
for i = 1:5
X(5) = x(i,j)+x(j,i)-(x(i,i)^2);
end
sum1(5) = sum(X);
end
SUM = sum(sum1);
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!