Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure 13.5 #2

Open
hsisti opened this issue May 5, 2023 · 2 comments
Open

Figure 13.5 #2

hsisti opened this issue May 5, 2023 · 2 comments

Comments

@hsisti
Copy link

hsisti commented May 5, 2023

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.

@mikexcohen
Copy link
Owner

mikexcohen commented May 5, 2023 via email

@hsisti
Copy link
Author

hsisti commented May 6, 2023

That worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants