summaryrefslogtreecommitdiff
path: root/openEMS/matlab/SetCustomExcite.m
diff options
context:
space:
mode:
Diffstat (limited to 'openEMS/matlab/SetCustomExcite.m')
-rw-r--r--openEMS/matlab/SetCustomExcite.m21
1 files changed, 21 insertions, 0 deletions
diff --git a/openEMS/matlab/SetCustomExcite.m b/openEMS/matlab/SetCustomExcite.m
new file mode 100644
index 0000000..6f87a49
--- /dev/null
+++ b/openEMS/matlab/SetCustomExcite.m
@@ -0,0 +1,21 @@
+function FDTD = SetCustomExcite(FDTD,f0,funcStr)
+% function FDTD = SetCustomExcite(FDTD,f0,funcStr)
+%
+% f0 : nyquist rate
+% funcStr : string desribing the excitation function e(t)
+%
+% see also SetSinusExcite SetGaussExcite
+%
+% e.g for a ramped sinus excite...
+% T = 1/f0;
+% FDTD = SetCustomExcite(FDTD,1e9,..
+% [ '(1-exp(-1*(t/' num2str(T) ')^2) ) * sin(2*pi*' num2str(f0) '*t)' ]);
+%
+% openEMS matlab interface
+% -----------------------
+% author: Thorsten Liebig
+
+FDTD.Excitation.ATTRIBUTE.Type=10;
+FDTD.Excitation.ATTRIBUTE.f0=f0;
+FDTD.Excitation.ATTRIBUTE.Function=funcStr;
+FDTD.ATTRIBUTE.f_max=f0;