From 27ea8d0bf589526114b2d17ed95389a9426bdede Mon Sep 17 00:00:00 2001 From: mwhite-IPA Date: Wed, 19 Mar 2014 17:35:15 -0400 Subject: [PATCH] Added .mata sample for Stata. Source: http://www.stata.com/help.cgi?m1_first --- samples/Stata/tanh.mata | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 samples/Stata/tanh.mata diff --git a/samples/Stata/tanh.mata b/samples/Stata/tanh.mata new file mode 100644 index 00000000..63504603 --- /dev/null +++ b/samples/Stata/tanh.mata @@ -0,0 +1,8 @@ +numeric matrix tanh(numeric matrix u) +{ + numeric matrix eu, emu + + eu = exp(u) + emu = exp(-u) + return( (eu-emu):/(eu+emu) ) +}