mattard54
Messages postés2Date d'inscriptionsamedi 1 juin 2013StatutMembreDernière intervention14 juin 2013
-
Modifié par mattard54 le 14/06/2013 à 11:08
Bonjour,
je suis en train d'écrire un code qui me permettra de faire s'afficher une trajectoire de particule et j'ai un problème en utilisant plot3, en effet l'erreur suivante s'affiche:
Error using plot3
Vectors must be the same lengths.
Error in codefini2 (line 339)
plot3(grandX,grandY,grandZ,'b','LineWidth',2,...
pourtant quand je fais afficher les vecteurs grandX, grandY et grandZ ils sont bien de la même longueur...
j'ai écrit ce qui suit:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Trajectoire dans le tokamak avec représentation de la surface du tore
grandX= [i,j];
grandY= [i,j];
grandZ= [i,j];
hold on;
for i=1:N
figure;
for j=1:length(xr(i,:))
grandX(i,j)=(R0+xr(i,j)*cos(xt(i,j)))*cos(xp(i,j));
grandY(i,j)=(R0+xr(i,j)*cos(xt(i,j)))*sin(xp(i,j));
grandZ(i,j)=-xr(i,j)*sin(xt(i,j));
end
plot3(grandX,grandY,grandZ,'b','LineWidth',3,...
'MarkerEdgeColor','b',...
'MarkerFaceColor','b',...
'MarkerSize',6)
axis square;
xlabel('X (m)','FontSize',30);
ylabel('Y (m)','FontSize',30);
zlabel('Z (m)','FontSize',30);
set(gca, 'FontSize', 20, 'fontName','Times');
end
si quelqu'un pouvait m'indiquer où est l'erreur ce serait vraiment sympa...
Merci