Skip to content

Figure 13.5 #2

Description

@hsisti

I'm trying to re-create Figure 13.5 and am receiving an error message. I've copied the code I'm using from the file and the error message I receive below. Thanks for writing such a great book!

%% Figure 13.5

% redefine time
time = -.5:1/srate:.5; % vector of time

figure

% plot real and imaginary parts of wavelet
plot(time,real(wavelet),'linew',2)
hold on
plot(time,imag(wavelet),':','linew',2)

% plot cosine and sine
plot(time,cos(2pifrequency.time),'m','linew',2)
plot(time,sin(2
pi*frequency.*time),'m:','linew',2)

% plot gaussian window
gaus_win = exp(-time.^2./(2*s^2));
plot(time,gaus_win,'k')
set(gca,'ylim',[-1.2 1.2])
xlabel('Time (s)')
legend({'real part of wavelet';'imaginary part of wavelet';'cosine';'sine';'Gaussian'})

Error using plot
Vectors must be the same length.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions