pressed on with a solution, but not confident I'm correct. All the parts are on the plot, but the max I found using the fmincon function doesn't seem right. below is the separate function code and problem code I've written for the problem:
Function Code:
function [c,ceq] = nonlcon(x)
%Non-linearinequalityconstraints:
c = (0.6)^2-(x(1)-0.4)^2 + (x(2)-0.4)^2;
ceq = [];
Problem Code:
% Used for plotting as it contains both x and y
z2 = @(x,y) (x/(sqrt(x.^2 + y.^2))).*(besselj(1, 3.8316.*sqrt(x.^2 + y.^2)));
% Used to find max at each function due to multiplying by (-1)
z1 = @(x) (-1)*(x(1)/(sqrt(x(1).^2 + x(2).^2))).*(besselj(1, 3.8316.*sqrt(x(1).^2 + x(2).^2)));
x0 = [0.5,-0.5];
[x,fval,exitflag,output] = fmincon(z1,x0,[],[],[],[],[],[],@nonlcon)
hold on
plot3(x(1,1),x(1,2), fval , 'ob', 'MarkerSize', 12);
ezmeshc(z2, [-1, 1, -1, 1]);
[x,y,z] = cylinder(0.6, 40);
mesh(x+0.4, y+0.4, 1.2*z-0.6, 'FaceAlpha', 0.8)
axis equal
view(-64, 14);
xlabel('x-axis');
ylabel('y-axis');
zlabel('z-axis');
legend('marker', 'grid', 'rings');