Question: I need help with my matlab code, can someone assist me to make it up to project specifications? The code is below, then the project

I need help with my matlab code, can someone assist me to make it up to project specifications? The code is below, then the project specifications are after. PLEASE help make my code WORK. IT NEEDS TO WORK AND SHOW EACH OF THE INCISIONS, AND THEN A RESULT WITH THE INCISIONS TOGETHER.
% Define the time intervals for the three cuts
t1=0:0.001:2.36;
t2=0:0.001:7.86;
t3=0:0.001:27.65;
% Define the control signals for the cutting head
x1= @(t)3+0.75* cos((4* t +2)/3);
y1= @(t)4+0.75* sin((4* t +2)/3);
x2= @(t)12-2* cos(0.5);
y2= @(t)4-2* sin(0.5);
x3= @(t)12+2* cos((t - t2+2* pi +1)/2);
y3= @(t)4+2* sin((t - t2+2* pi +1)/2);
% Calculate the parameters for the cutting head control signals
A = abs(x2(0)- x1(0)+1i *(y2(0)- y1(0)));
theta = angle((x2(0)- x1(0))+1i *(y2(0)- y1(0)));
% Define the control signals for the cutting head
ax = @(t) x1(t)+0.75* cos((4* t +2)/3);
ay = @(t) y1(t)+0.75* sin((4* t +2)/3);
bx = cos(theta);
by = sin(theta);
cx = @(t) x3(t)+2* cos((t - t2+2* pi +1)/2);
cy = @(t) y3(t)+2* sin((t - t2+2* pi +1)/2);
% Plot the signals x(t) and y(t) versus time on the same graph
figure;
subplot(2,2,1);
plot(t1, x1(t1),'b', t2, x2(t2),'r', t3, x3(t3),'g');
xlabel('Time (sec)');
ylabel('x(t)');
title('x(t) versus Time');
subplot(2,2,2);
plot(t1, y1(t1),'b', t2, y2(t2),'r', t3, y3(t3),'g');
xlabel('Time (sec)');
ylabel('y(t)');
title('y(t) versus Time');
% Plot y(t) versus x(t) for all three cuts separately
subplot(2,2,3);
plot(x1(t1), y1(t1),'b', x2(t2), y2(t2),'r', x3(t3), y3(t3),'g');
xlabel('x(t)');
ylabel('y(t)');
title('y(t) versus x(t) for all three cuts separately');
% Plot y(t) versus x(t) for all three cuts on the same figure
subplot(2,2,4);
plot(x1(t1(1:1000)), y1(t1(1:1000)),'b', x2(t2(1:1000)), y2(t2(1:1000)),'r', x3(t3(1:1000)), y3(t3(1:1000)),'g');
xlabel('x(t)');
ylabel('y(t)');
title('y(t) versus x(t) for all three cuts on the same figure');
% Add a legend
legend('First Cut', 'Second Cut', 'Third Cut', 'Location', 'NorthEast');
% Show the plot
show();
PROJECT SPECIFCATIONS
A laser cutting surgical tool needs to be programmed to perform an incision in a human ilium (pelvic/hip
bone) rectangular area of 8-mm by 16-mm.
The additional cuts within the incised rectangular piece that is removed are to have the shapes (within
the rectangular region).
In order to produce such an incision, three separate cuts are required.
The first cut is produced during a time interval 0<= t <=2.36 sec with the cutting head control signals:
x(t)=3+0.375 cos(t /0.375) and y(t)=4+0.375 sin(t /0.375)
The second cut is produced during a time interval 0<= t <=7.86 sec with the cutting head control signals:
x(t)=12+1.25 cos(t /1.25) and y(t)=4+1.25 sin(t /1.25)
The third and final cut is produced during a time interval 0<= t <=27.65 sec with the cutting head control
signals:
x(t)= ax(t)[u(t)- u (t-t1)]+ x1u(t-t1)+ bx [r(t-t1)- r (t-t2)]-x2u(t-t2)+ cx(t)[u(t-t2)-u(t-t3)]- bxr(t-t3)+ y3u(t-t3)
y(t)= ay(t)[u(t)- u (t-t1)]+ y1u(t-t1)+ by [r(t-t1)- r (t-t2)]-y2u(t-t2)+ cy(t)[u(t-t2)-u(t-t3)]+ byr(t-t3)+ y3u(t-t3)
where
x1=3+0.75 cos (2/3), x2=12-2 cos (0.5),
y1=4-0.75 sin (2/3), y2=4-2sin (0.5),
y3=4+2 sin (0.5), A =|(x2- x1)+ j(y2-y1)|,
theta = phase angle ((x2-x1)+ j(y2-y1), t1=1.5pi -1,
t2= t1+ A, t3= t2+4pi -2, bx = cos(theta), by = sin(theta), ax(t

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!