MATLAB Graphing 3D Z-Transform in MATLAB

AI Thread Summary
To graph the Z-Transform in 3D, users can utilize MATLAB's Symbolic Math Toolbox, which offers functions for calculating Z-transforms. While core MATLAB lacks a direct function for this purpose, resources on the MATLAB File Exchange may provide useful alternatives. For 3D plotting, functions like meshgrid() and surf() are essential. Users can create a grid of points and compute the Z-transform values to visualize them. A sample code snippet demonstrates how to set up the grid and surface plot, but users may encounter errors if the function 'test' is undefined. This indicates that a specific function for the Z-transform needs to be defined or replaced in the code. Overall, successful plotting requires both the correct function definition and the proper use of MATLAB's plotting tools.
enceladus_
Messages
58
Reaction score
0
Does anyone know how I might go about graphing the Z-Transform in 3D? It want it to look something like the picture below.
 

Attachments

  • ztransform.jpg
    ztransform.jpg
    22.2 KB · Views: 911
Physics news on Phys.org
Are you interested in knowing how to plot in 3D, or how to calculate the z transform? Do you have access to Symbolic Math Toolbox? If so, there are some helpful functions in it for doing z transforms. I don't think core MATLAB has a function for it but there is probably something on the file exchange. This may also be relevant:

http://www.mathworks.com/help/matlab/data_analysis/filtering-data.html#bqm3i7m-5

Otherwise, the plot you're looking at probably came from using meshgrid() and surf(), then overlaying the unit circle values with a call to plot3().
 
  • Like
Likes 1 person
More so plotting in 3d, I've never used meshgrid or surf before. I do have access to the Symbolic Toolbox. Would I have to use BOTH meshgrid() and surf()?
 

Attachments

  • vh11.jpg
    vh11.jpg
    30.2 KB · Views: 1,320
Last edited:
I have found this code from another site:

xmin = -2; xstep = 0.1; xmax = 2;
ymin = -2; ystep = 0.1; ymax = 2;
x = xmin : xstep : xmax;
y = ymin : ystep : ymax;
[X,Y] = meshgrid(x,y);

Z = 10*log10(abs(test(X + j*Y))); % here is the call to the function to be plotted.
Z2 = abs(X + j*Y) <=1; % Here is the mask the zeros things outside the unit circle

hold off
surf(X, Y, Z) % Draw and label the surface
colormap(cool)
xlabel('Re')
ylabel('Im')

ww=-pi:pi/25:pi;

[xn, yn, zn] = freqMove(0, ww);
hold on
plot3(xn, yn, zn)

It generates the following error:

Undefined function 'test' for input arguments of type 'double'.

Error in hmm (line 7)
Z = 10*log10(abs(test(X + j*Y))); % here is the call to the function to be plotted.
 

Attachments

  • figure2.gif
    figure2.gif
    6.5 KB · Views: 1,166
Last edited:

Similar threads

Replies
5
Views
2K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
4
Views
2K
Replies
32
Views
4K
Replies
1
Views
1K
Back
Top