MATLAB: Plot3

plot3

how do a plot3 of a wavelet tranform showing time, scale and wavelet coefficients

Best Answer

Hi Lisa, To use plot3, you must have your time (position) and scale vectors as matrices because the CWT coefficients are in a matrix.
You can use meshgrid() to transform your time and scale vectors into matrices suitable for plot3()
t = 1:1024;
a = 1:30;
Wt = abs(randn(30,1024));
[T,A] = meshgrid(t,a);
plot3(T,A,Wt); xlabel('time');
ylabel('Scale'); zlabel('CWT magnitude');
However, I think you may find surf() better here
surf(t,a,Wt); shading interp;
xlabel('time'); ylabel('scale'); zlabel('CWT magnitude');