2

Let's say I have a function called $f(t)$ in time domain as:

$$f(t) = \exp(-3t)\cos(5t)$$

And the Laplace transform of this function call it $F(s)$ becomes:

$$F(s)=\frac{(s + 3)}{(s + 3)^2 + 25}$$

I want to plot the 3D plot of $\lvert F(s)\rvert$ as a surface above the $s$-plane.

I couldn't find any script. I have the version R2014a of MATLAB. How is this done in MATLAB? Something similar to this plot:

enter image description here

Gilles
  • 3,386
  • 3
  • 21
  • 28
user16307
  • 327
  • 1
  • 6
  • 15
  • Look into meshgrid, there are plenty of examples of 3D plots using MATLAB and this function that should help you – Dan Boschen Apr 29 '17 at 16:22
  • I couldn't find a single one in hours of search, can you provide me a link if you know where they have an example how they plot Laplace transform above the s plane? Specifically Laplace transform's magnitude above the s plane. – user16307 Apr 29 '17 at 16:23
  • I do have such an example- I will put it up as an answer for you when I get home later tonight – Dan Boschen Apr 29 '17 at 18:25
  • https://www.mathworks.com/help/matlab/learn_matlab/creating-mesh-and-surface-plots.html – Dan Boschen Apr 29 '17 at 21:13

1 Answers1

4
[X,Y] = meshgrid(-10:.1:10);
s=X+j*Y;
Z= abs((s+3)./((s+3).^2+25));
mesh(X,Y,Z)

3d plot

Dan Boschen
  • 50,942
  • 2
  • 57
  • 135