diff --git a/matlab/PlotHDF5FieldData.m b/matlab/PlotHDF5FieldData.m index b1b5134..ae0f633 100644 --- a/matlab/PlotHDF5FieldData.m +++ b/matlab/PlotHDF5FieldData.m @@ -1,4 +1,17 @@ function PlotHDF5FieldData(file, PlotArgs) +% function PlotHDF5FieldData(file, PlotArgs) +% +% e.g. +% PlotArgs.slice = {0 [10 20] 0}; +% PlotArgs.pauseTime=0.01; +% PlotArgs.component=2; +% PlotArgs.Limit = 'auto'; +% +% PlotHDF5FieldData('tmp/Et.h5',PlotArgs) +% +% openEMS matlab interface +% ----------------------- +% author: Thorsten Liebig component = PlotArgs.component; @@ -50,14 +63,18 @@ for n=1:numel(Field) title(fields.names{n}); %view(3) axis equal -% if (isfield(PlotArgs,'zlim')) -% if ~ischar(PlotArgs.zlim) -% zlim(PlotArgs.zlim); -% elseif strcmp(PlotArgs.zlim,'auto') -% zlim([-max_amp*(component>0) max_amp]); -% end -% end -% + if (isfield(PlotArgs,'Limit')) + if ~ischar(PlotArgs.Limit) + caxis(PlotArgs.Limit); + elseif strcmp(PlotArgs.Limit,'auto') + if (component>0) + caxis([-max_amp,max_amp]); + else + caxis([0,max_amp]); + end + end + end + drawnow pause(pauseT) end \ No newline at end of file diff --git a/matlab/ReadHDF5FieldData.m b/matlab/ReadHDF5FieldData.m index 0524a99..83471a6 100644 --- a/matlab/ReadHDF5FieldData.m +++ b/matlab/ReadHDF5FieldData.m @@ -1,4 +1,13 @@ function hdf_fielddata = ReadHDF5FieldData(file) +% function hdf_fielddata = ReadHDF5FieldData(file) +% +% returns: +% hdf_fielddata.names +% hdf_fielddata.values +% +% openEMS matlab interface +% ----------------------- +% author: Thorsten Liebig info = hdf5info(file); diff --git a/matlab/ReadHDF5Mesh.m b/matlab/ReadHDF5Mesh.m index 5988e90..3aa4f35 100644 --- a/matlab/ReadHDF5Mesh.m +++ b/matlab/ReadHDF5Mesh.m @@ -1,4 +1,14 @@ function hdf_mesh = ReadHDF5Mesh(file) +% function hdf_mesh = ReadHDF5Mesh(file) +% +% returns: +% hdf_mesh.type +% hdf_mesh.names +% hdf_mesh.lines +% +% openEMS matlab interface +% ----------------------- +% author: Thorsten Liebig info = hdf5info(file); diff --git a/matlab/ReadUI.m b/matlab/ReadUI.m index ce940ee..19d5809 100644 --- a/matlab/ReadUI.m +++ b/matlab/ReadUI.m @@ -1,4 +1,16 @@ function UI = ReadUI(files, path) +% function UI = ReadUI(files, path) +% +% read current and voltages from multiple files found in path +% +% returns voltages/currents in time and frequency-domain +% +% e.g. +% UI = ReadUI({'ut1_1','ut1_2','it1'},'tmp/'); +% +% openEMS matlab interface +% ----------------------- +% author: Thorsten Liebig if (nargin<2) path =''; diff --git a/matlab/SetBoundaryCond.m b/matlab/SetBoundaryCond.m index ed5ba8c..f3b73e9 100644 --- a/matlab/SetBoundaryCond.m +++ b/matlab/SetBoundaryCond.m @@ -3,6 +3,10 @@ function FDTD = SetBoundaryCond(FDTD,BC) % % BC = [xmin xmax ymin ymax zmin zmax]; % ?min/?max: 0=PEC 1=PMC +% +% openEMS matlab interface +% ----------------------- +% author: Thorsten Liebig FDTD.BoundaryCond.ATTRIBUTE.xmin=BC(1); FDTD.BoundaryCond.ATTRIBUTE.xmax=BC(2); diff --git a/matlab/WriteOpenEMS.m b/matlab/WriteOpenEMS.m index 68dbf3b..691a0a4 100644 --- a/matlab/WriteOpenEMS.m +++ b/matlab/WriteOpenEMS.m @@ -1,4 +1,9 @@ function WriteOpenEMS(filename, FDTD, CSX) +% function WriteOpenEMS(filename, FDTD, CSX) +% +% openEMS matlab interface +% ----------------------- +% author: Thorsten Liebig openEMS.FDTD = FDTD; openEMS.ContinuousStructure = CSX;