<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hello<br><br>An supposed charge in in origin. Thus it create a vector field around it. This can be obtained from Coulomb's law. When I tried to create the vector field caused by this charge I used the commands:<br><br>x=-1:0.1:1;  <br>y=x;<br>[X Y]=meshgrid(x,y)<br>r=sqrt(X.^2+Y.^2)+%eps //I sumed with eps to avoid a error by division for 0<br>ax=X./r;<br>ay=Y./r<br>champ(x,y,ax,ay)<br><br>The field that I got with those command lines wasn't what I wanted. but using the code bellow Scilab took the correct field.<br><br>x=-1:0.1:1;  <br>
y=x;<br>
[Y X]=meshgrid(x,y)<br>
r=sqrt(X.^2+Y.^2)+%eps //I sumed with eps to avoid a error by division for 0<br>
ax=X./r;<br>
ay=Y./r<br>
champ(x,y,ax,ay)<br><br>Acording to manual the first code should give me the correct field. In Octave a similar code gave me the correct field. Is seems thar or champ or meshgrid function inverted the things in Scilab.<br></td></tr></table><br>