Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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 vue (au cours des 30 derniers jours)
Kelil Mohammed
Kelil Mohammed le 6 Mai 2018
Clôturé : MATLAB Answer Bot le 20 Août 2021
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

Réponses (0)

Cette question est clôturée.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by