matlab interface: update to docu & HDF5 plot function

pull/1/head
Thorsten Liebig 2010-04-24 16:43:22 +02:00
parent e0ecd5c99d
commit 62cb98a307
6 changed files with 65 additions and 8 deletions

View File

@ -1,4 +1,17 @@
function PlotHDF5FieldData(file, PlotArgs) 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; component = PlotArgs.component;
@ -50,14 +63,18 @@ for n=1:numel(Field)
title(fields.names{n}); title(fields.names{n});
%view(3) %view(3)
axis equal axis equal
% if (isfield(PlotArgs,'zlim')) if (isfield(PlotArgs,'Limit'))
% if ~ischar(PlotArgs.zlim) if ~ischar(PlotArgs.Limit)
% zlim(PlotArgs.zlim); caxis(PlotArgs.Limit);
% elseif strcmp(PlotArgs.zlim,'auto') elseif strcmp(PlotArgs.Limit,'auto')
% zlim([-max_amp*(component>0) max_amp]); if (component>0)
% end caxis([-max_amp,max_amp]);
% end else
% caxis([0,max_amp]);
end
end
end
drawnow drawnow
pause(pauseT) pause(pauseT)
end end

View File

@ -1,4 +1,13 @@
function hdf_fielddata = ReadHDF5FieldData(file) 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); info = hdf5info(file);

View File

@ -1,4 +1,14 @@
function hdf_mesh = ReadHDF5Mesh(file) 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); info = hdf5info(file);

View File

@ -1,4 +1,16 @@
function UI = ReadUI(files, path) 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) if (nargin<2)
path =''; path ='';

View File

@ -3,6 +3,10 @@ function FDTD = SetBoundaryCond(FDTD,BC)
% %
% BC = [xmin xmax ymin ymax zmin zmax]; % BC = [xmin xmax ymin ymax zmin zmax];
% ?min/?max: 0=PEC 1=PMC % ?min/?max: 0=PEC 1=PMC
%
% openEMS matlab interface
% -----------------------
% author: Thorsten Liebig
FDTD.BoundaryCond.ATTRIBUTE.xmin=BC(1); FDTD.BoundaryCond.ATTRIBUTE.xmin=BC(1);
FDTD.BoundaryCond.ATTRIBUTE.xmax=BC(2); FDTD.BoundaryCond.ATTRIBUTE.xmax=BC(2);

View File

@ -1,4 +1,9 @@
function WriteOpenEMS(filename, FDTD, CSX) function WriteOpenEMS(filename, FDTD, CSX)
% function WriteOpenEMS(filename, FDTD, CSX)
%
% openEMS matlab interface
% -----------------------
% author: Thorsten Liebig
openEMS.FDTD = FDTD; openEMS.FDTD = FDTD;
openEMS.ContinuousStructure = CSX; openEMS.ContinuousStructure = CSX;