Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

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 visualización (últimos 30 días)
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

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by