Borrar filtros
Borrar filtros

In Quiver Function Error: " index must be a positive integer or logical."

1 visualización (últimos 30 días)
Hey,
I get the error
??? Attempted to access quiver(2.76604,2.17365,-0.123257,0.81116); index must be a positive integer or logical.
and can't imagine why, because if I type quiver(2.76604,2.17365,-0.123257,0.81116) in the Command Window it works well.
Here is the Code:
for k=1:n
for l=1:n
if E(k,l) >= 1
x1=2+cos(2*pi/n*k); x2=2+cos(2*pi/n*l); y1=2+sin(2*pi/n*k); y2=2+sin(2*pi/n*l);
u=y1-x1; v=y2-x2;
quiver(x1,x2,u,v);%,'Color',color,'LineWidth',2);
end
end
end
with n=length(E) and E(i,j) = 1 if there excists an arrow between i and j
Thank You Daniel
  3 comentarios
Daniel
Daniel el 13 de Ag. de 2013
Hmm this is weird because if I run exactly your modification of the code I get the error:
??? Attempted to access quiver(1.5,1.5,1.36603,1.36603); index must be a positive integer or logical.
Error in paintgraph at 23
quiver(x1,x2,u,v);
I can't imagine why. Yes the code I presented yields the error.
Daniel
Daniel el 13 de Ag. de 2013
Got the solution. I accidantly set quiver=1 earlier.
Thank you very much.

Iniciar sesión para comentar.

Respuesta aceptada

Sajid Khan
Sajid Khan el 13 de Ag. de 2013
use clear all before executing your code.

Más respuestas (0)

Categorías

Más información sobre Naming Conventions en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by