Code for elements in equation to create a matrix
2 次查看(过去 30 天)
显示 更早的评论
D is a 1x3 matrix
f is a 3x3 matrix
I want to create a matrix of A by the following equation:
for j=1:3
for i=1:3
A(i)=(sum(D(j).*f(i,j)))^-1;
end
end
But it turns out that the answer is wrong
What should be the correct code of this equation?
0 个评论
采纳的回答
更多回答(1 个)
Muhammad Tabish Bilal
2021-4-22
for counter1= 1: 13 % counter for the rows of intended matrices
for counter2= 1 : 13 % counter for coloumns of intended matrices
SMO(counter1,counter2) = counter1+counter2; % here you may use the equation you want to drive a matrices from but keep in mind it should be a column matrices using the same counter of inner loop
end
end
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!