how can I write code to reach my goal as figure below?
1 次查看(过去 30 天)
显示 更早的评论
Hi guys,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/565696/image.png)
P is a matrix with dimension i*j; n is an integer. How can I write this formula in matlab? Thanks.
2 个评论
Adam Danz
2021-3-28
What part are you having trouble with? How can we help without doing it for you?
回答(1 个)
Adam Danz
2021-3-29
编辑:Adam Danz
2021-3-29
> in fact I was trying a loop to give the value for ri
r is an existing matrix. i and k are just indices. So the value of ri is just r(i,:) and the value of rik is r(i,k).
> also Ci and Vi
What's Vi?
For C, is this what you're looking for?
%n = ?? % scalar
%r = ?? % size nxn
C = nan(1,n);
for i = 1:n
C(i) = nthroot(prod(r(i,1:n)),n);
end
which is the same as
%n = ?? % scalar
%r = ?? % size nxn
C = nthroot(prod(r(1:n,1:n),2),n)
3 个评论
Adam Danz
2021-3-29
I don't follow what you're saying and it seems like the question and background information is changing with each comment. I've already reached my allotted volunteer time for the day but I can check back later to see if there is a crystal clear question with all the needed background information.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!