Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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 Ansicht (letzte 30 Tage)
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

Antworten (0)

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by