quiver3 and vector length
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello !
I've got a problem when plotting a vector field with quiver3. My z compounds are about 1e-10 T but when plotted into quiver, it appears to be 1e-03 T which is a big difference ! (Symmetrically, when it's about 1 T in the vector, it's 1e-03 T plotted whith quiver).
Here is some data :
The z-compounds :
1.0e-09 *
-0.4670
-0.4328
-0.3918
-0.3447
-0.2923
-0.2355
-0.1753
-0.1126
-0.0485
0.0160
0.0798
0.1421
0.2017
0.2579
0.3098
and so on...
As you can see, some are positive and other negative but when plotted, it seems everything is the same...
Here is the plot :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/158304/image.png)
And finally, here is the code with some explanation :
figure(1);
quiver3(position_bobine(:,1), position_bobine(:,2),position_bobine(:,3),B_elem(:,1),B_elem(:,2),B_elem(:,3));
hold on
plot3(aimant(:,1), aimant(:,2), aimant(:,3),'.b')
hold on
pts1 = position_bobine-orientation_bobine/2;
pts2 = position_bobine+orientation_bobine/2;
plot3( [pts1(:,1), pts2(:,1)]', [pts1(:,2), pts2(:,2)]', [pts1(:,3), pts2(:,3)]', '.-r');
axis([-0.02 0.02 -0.02 0.02 -5e-3 5e-3]);
xlabel('x'), ylabel('y'), zlabel('z');
title('Vector magnetic field around the coil');
hold off
Where position_bobine is a 50*3 matrix, as well as B_elem and the first function plot3 just plot the magnet and the second the coil. (On the grpah upper, the magnet seems to be too away from the center, it's normal). The z-compounds given beyond are given by B_elem(:,3)
I hope you'll be able to help me, thanks in advance.
Edit: after a few tests, the problem seems to happend when modifying axes...
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Vector Fields en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!