Info

此问题已关闭。 请重新打开它进行编辑或回答。

how to fix error "index exceeds matrix dimension"?" from 60 by 2 matrix I want to calculate perimeter of ABC formed by three anchor nodes in WSN.I got error message 'index exceeds matrix dimension' .

1 次查看(过去 30 天)
function perim = perimeter(AB,AC,BC) perim = AB+AC+BC;
if neighboring_anchor_n>=3
gridmap=zeros(row_n,col_n);
grid_covered_flag=zeros(row_n,col_n);
perim =sqrt(transpose((neighboring_anchor_n(1,1)-neighboring_anchor_n(2,1)).^2+(neighboring_anchor_n(1,2)-neighboring_anchor_n(2,2)).^2)+sqrt(transpose((neighboring_anchor_n(1,1)-neighboring_anchor_n(3,1)).^2+(neighboring_anchor_n(1,2)-neighboring_anchor_n(3,2)).^2)+sqrt(transpose((neighboring_anchor_n(2,1)-neighboring_anchor_n(3,1)).^2+(neighboring_anchor_n(2,2)-neighboring_anchor_n(3,2)).^2);
end
end

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by