Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MATLAB help ity 5. (40 pts) Don\'t you want to create a Batman using MATLAB? Eac

ID: 3741365 • Letter: M

Question

MATLAB help

ity 5. (40 pts) Don't you want to create a Batman using MATLAB? Each piece of Batman is actually a line created by the plot () function. I used 6 function calls of plot0, but every code is different so you may use more or less. And all boundaries will have to be read from the picture on the next page. Batman Here is how you construct the curves: 1). Each wing curve is a portion of the ellipse described by the equation: -I. Pick either x or y as the independent variable, solve for the other. Keep in mind he square root can take either positive or negative sign. 2).The bottom curve is described by the equation: x3 33-7 112 3). Each shoulder curve is described by the equation: 6/10 y+1.5-0.5 6 10 14 1) 4). The head consists of straight lines, so it can be done in the dot-to-dot way If you feel the equation is too impressive, don't give up! Split if off into little pieces; double-check or triple-check your equations. Remember to use element-per-element operators (.*or./or.A) To set the x, y range and the axis label, do this: set (gca ,"XLin', [-7,7] ,' YL?n', [-5,5] ,'XT?ck',-7:7, ,YT?ck',-5:5) To set the fond size of the title, add ' Font Size ' , #value as the arguments. You can also set the line width in the plot command, ' Linewidth' , #value

Explanation / Answer

%%%%%%% Bottom %%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%

x = -7:0.1:7;

%%%%%% Wings %%%%%%%%%%   
y = -3*sqrt(1-((x(1:31).*x(1:31))/49));

plot(x(1:31),y,'k');
hold on;

%%%%%%% Tail %%%%%%%%%%%
y1 = abs(x(31:111)./2) - ((((3*sqrt(33))-7)/112).*x(31:111).*x(31:111)) + sqrt(1 - (abs(abs(x(31:111))-2)-1).^2) - 3;

plot(x(31:111),y1,'k');
hold on

%%%%%%% Wings %%%%%%%%%%%
y2 = -3*sqrt(1-((x(111:141).*x(111:141))/49));
plot(x(111:141),y2,'k');


%%%%%%%%%% Upper %%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%% Wings %%%%%%%%%%   
y3 = 3*sqrt(1-((x(1:41).*x(1:41))/49));
plot(x(1:41),y3,'k');
hold on;

%%%%%%% Shoulder %%%%%%%%%%%
y4 = 6*sqrt(10)/7 + 1.5 - 0.5.*abs(x(41:61)) - ((6*sqrt(10)/14) .* (sqrt(4 - (abs(x(41:61))-1).^2)));
plot(x(41:61),y4,'k');
hold on;

y5 = 6*sqrt(10)/7 + 1.5 - 0.5.*abs(x(81:101)) - ((6*sqrt(10)/14) .* (sqrt(4 - (abs(x(81:101))-1).^2)));
plot(x(81:101),y5,'k');
hold on;

%%%%%%%%%% Head %%%%%%%%%%%%
plot([-1,-0.8],[1,3],'k');
plot([-0.8,-0.6],[3,2.1],'k');
plot([-0.6,0.6],[2.1,2.1],'k');
plot([0.6,0.8],[2.1,3],'k');
plot([0.8,1],[3,1],'k');


%%%%%%% Wings %%%%%%%%%%%
y6 = 3*sqrt(1-((x(101:141).*x(101:141))/49));
plot(x(101:141),y6,'k');
set(gca,'Color','y');