B = 1.5;

z = linspace(0,2,1000);
f = cosh(z) - B./z.*sinh(z);

subplot(211);
plot(z,f);
xlabel('z');
ylabel('f(z)');
ylim([-1 1.5]);
title('PS#2, Question 2: Negative energy solutions (B = 1.5)');
grid on;

subplot(212);
z = linspace(0,10,1000);
f = cos(z) - B./z.*sin(z);
plot(z,f);
xlabel('z');
ylabel('f(z)');
ylim([-1.5 1.5]);
title('Positive energy solutions');
grid on;