%
% @file pex5.m
%
% @brief Plot particle position from pex4 using MATLAB
%
% @copyright
% Copyright (©) 2021 EPFL (Ecole Polytechnique Fédérale de Lausanne)
% SPC (Swiss Plasma Center)
%
% futils is free software: you can redistribute it and/or modify it under
% the terms of the GNU Lesser General Public License as published by the Free
% Software Foundation, either version 3 of the License, or (at your option)
% any later version.
%
% futils is distributed in the hope that it will be useful, but WITHOUT ANY
% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
% FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
%
% You should have received a copy of the GNU Lesser General Public License
% along with this program. If not, see .
%
% @authors
% (in alphabetical order)
% @author Trach-Minh Tran
%
figure;
coor=hdf5read('part_000.h5', 'part');
r=coor(:,1);
z=coor(:,2);
phi=coor(:,3);
x=r.*cos(phi);
y=r.*sin(phi);
subplot(221)
scatter3(x,y,z,'.'); axis equal;xlabel('X');ylabel('Y');zlabel('Z')
title('part_000.h5')
coor=hdf5read('part_001.h5', 'part');
r=coor(:,1);
z=coor(:,2);
phi=coor(:,3);
x=r.*cos(phi);
y=r.*sin(phi);
subplot(222)
scatter3(x,y,z,'.'); axis equal;xlabel('X');ylabel('Y');zlabel('Z')
title('part_001.h5')
coor=hdf5read('part_002.h5', 'part');
r=coor(:,1);
z=coor(:,2);
phi=coor(:,3);
x=r.*cos(phi);
y=r.*sin(phi);
subplot(223)
scatter3(x,y,z,'.'); axis equal;xlabel('X');ylabel('Y');zlabel('Z')
title('part_002.h5')
coor=hdf5read('part_003.h5', 'part');
r=coor(:,1);
z=coor(:,2);
phi=coor(:,3);
x=r.*cos(phi);
y=r.*sin(phi);
subplot(224)
scatter3(x,y,z,'.'); axis equal;xlabel('X');ylabel('Y');zlabel('Z')
title('part_003.h5')