for i=1:40
structure(i,:,:)=rombohedral((i-1)*338+1:i*338,:);
X=structure(i,:,4);
Y=structure(i,:,5);
Z=structure(i,:,6);
U=structure(i,:,7);
V=structure(i,:,8);
W=structure(i,:,9);
C=zeros(338,3);
C(1:300,1)=1;
C(300:end,2)=1;
figure(i)
figure(i)
title('2D')
t=num2str(i);
xlabel([t,' ps'])
hold on
for j=1:338
if (U(j)>0)
quiver(X(j),Y(j),U(j),W(j),'color',[1 0 0])
elseif (U(j)<0)
quiver(X(j),Y(j),U(j),W(j),'color',[0 1 1])
elseif (V(j)>0)
quiver(X(j),Y(j),W(j),V(j),'color',[0 1 0])
elseif (V(j)<0)
quiver(X(j),Y(j),W(j),V(j),'color',[1 0 1])
end
end
end
2 Comments
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/490351-different-colours-for-arrows-in-quiver-plot#comment_765987
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/490351-different-colours-for-arrows-in-quiver-plot#comment_765987
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/490351-different-colours-for-arrows-in-quiver-plot#comment_766040
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/490351-different-colours-for-arrows-in-quiver-plot#comment_766040
Sign in to comment.