I am trying to create a 3D plot. I am trying to use the values from xvals and yvals to get a Z value,but I am getting two errors. One is saying that the data dimensions should agree and its also saying that the mesh(X,Y,Z) has an error while evaluating callback. Any suggestions to get this to plot? Thanks
xvals = 1.00:0.1:5.75;
yvals = 2.5:0.1:12.5;
[X,Y] = meshgrid(xvals,yvals);
AB01 = sqrt((-21.6 - X).^2 + (-5.612 - Y).^2);
AA0 = 22.269;
pivotlength = sqrt(X.^2 + Y.^2);
l = AB01-7.5;
b = (pivotlength.^2 + AB01.^2 - AA0^2);
ee = (2*pivotlength.*AB01);
bb= b/ee;
thetalmax = acosd(bb);
c = (pivotlength.^2 + l.^2 -AA0^2)/(2*pivotlength.*l);
thetalmin = acosd(c);
Z = thetalmin - thetalmax ;
mesh(Y,X,Z);