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

MATLAEB A computer numerical control (CNC) router is used for cutting materials.

ID: 2325615 • Letter: M

Question

MATLAEB A computer numerical control (CNC) router is used for cutting materials. The path of the CNC router can be represented by the equations: x = 5+Vt y 2+sin(2t)/(t +1) Where x and y are coordinates of the router with respect to time t which is between 0 and 10 seconds. Create a script file using the two equations and do the following tasks: a) Show the path of the CNC router using x and y vectors b) Find and display the corresponding time t for the minimum value in the y vector c) Find and display the corresponding x value for the minimum value in the y vector d) Function z·xy, show z values versus time t

Explanation / Answer

clc
close all
clear all

%% Defining function

t=0:0.01:10; % Defining time step

x=5+sqrt(t);
y=2+sin(2*t)./(t+1);
z=x.*y;

%% Plotting the path

figure

hold on
plot(x,y,'linewidth',2);
xlabel('X Coordinate')
ylabel('Y coordinate')
title('Cutting Path')
grid on

text(x(end),y(end),' t=10 ','HorizontalAlignment','left');

%% Time for minimum value of x

index_xmin = find(min(x) == x);
xmin = x(index_xmin);
ymin = y(index_xmin);
tmin= t(index_xmin);

txt=[' At t=',num2str(tmin),' ,X min X=',num2str(xmin),' Y=',num2str(ymin)];
text(xmin,ymin,txt,'HorizontalAlignment','left');
%% Time for minimum value of x

index_ymin = find(min(y) == y);
xmin = x(index_ymin);
ymin = y(index_ymin);
tmin= t(index_ymin);

txt=[' At t=',num2str(tmin),' ,Y min X=',num2str(xmin),' Y=',num2str(ymin)];
text(xmin,ymin,txt,'HorizontalAlignment','left');