# Ngô Quốc Anh

## January 29, 2013

Filed under: Linh Tinh — Tags: — Ngô Quốc Anh @ 5:37

I found this interesting note regarding to Matlab. In that note, they plotted the word HI using Matlab. Here I try to use MuPAD in order to get a slightly better picture.

As mentioned in the note, the full function we need to use is

$\displaystyle e^{-x^2-\frac{1}{2}y^2} \cos(4x) + e^{-3\big( (x+\frac{1}{2})^2+\frac{1}{2}y^2 \big)}.$

If you plot that full function, what you are going to have is the following picture

The idea is to use the cut off of f within the range $[-\frac{1}{1000}, \frac{1}{500}]$. To achieve that goal, we use the following modified function

$\displaystyle \max(\min(f,\frac{1}{1000}),-\frac{1}{500}).$

Following is what you shall get.

The code I have used here is the following

f := exp(-x^2-y^2/2)*cos(4*x) + exp(-3*((x+1/2)^2+y^2/2)):
plot(plot::Function3d(max(min(f,1/1000),-1/500), x = -4 .. 4, y = -6 .. 6, Mesh = [15, 15], XSubmesh = 5, YSubmesh = 5));

Enjoy.