Group 01
Group 01
4A
disp("y=e^-x sin(y)+10√z")
y=e^-x sin(y)+10√z
y = 28.2890
4B
disp("To evaluate the following expression:")
a=30;
answer= sind(a)^2 + cosd(a)^2
answer = 1.0000
4C
disp("To evaluate the expression:")
disp("sin^-1(0.5)+cos^-1(0.5)")
sin^-1(0.5)+cos^-1(0.5)
asind(0.5)+ acosd(0.5)
ans = 90.0000
4D
1
EVALUATE THE ROOTS OF THE FOLLOWING POLYNOMIALS
4D(i)
disp("y=x^2-5x+6")
y=x^2-5x+6
y=[1,-5,6]
y = 1×3
1 -5 6
ans=roots(y)
ans = 2×1
3.0000
2.0000
4D(ii)
disp("y=x^3-2x^2-3x+10")
y=x^3-2x^2-3x+10
y=[1,-2,-3,10]
y = 1×4
1 -2 -3 10
ans=roots(y)
7A
disp("Two sets data x=[1 2 3 4 5 6] and y=[3 -1 2 4 5 1]")
x=[1 2 3 4 5 6]
x = 1×6
1 2 3 4 5 6
2
y=[3 -1 2 4 5 1]
y = 1×6
3 -1 2 4 5 1
plot(x,y,'m_--')
7B
disp("plot the graph of y=sin(x)")
x=[0:0.5/pi:4*pi]
x = 1×79
0 0.1592 0.3183 0.4775 0.6366 0.7958 0.9549 1.1141
y=sin(x)
y = 1×79
0 0.1585 0.3130 0.4595 0.5945 0.7144 0.8163 0.8975
plot(x,y,'r_-')
3
7C
disp("plot the graph of y=sin(x)")
x=[0:0.5/pi:4*pi]
x = 1×79
0 0.1592 0.3183 0.4775 0.6366 0.7958 0.9549 1.1141
y=sin(x)
y = 1×79
0 0.1585 0.3130 0.4595 0.5945 0.7144 0.8163 0.8975
plot(x,y,'r_-')
xlabel('0≤x≤4π')
ylabel('y=sin(x)')
title('GRAPH OF SINE FUNCTION')
4
7D
disp("Plot the functions y1=2cos(x),y2=cos(x),y3=0.5cos(x)")
x=[0:0.5/pi:4*pi]
x = 1×79
0 0.1592 0.3183 0.4775 0.6366 0.7958 0.9549 1.1141
y1=2*cos(x)
y1 = 1×79
2.0000 1.9747 1.8995 1.7763 1.6082 1.3995 1.1553 0.8820
y2=cos(x)
y2 = 1×79
1.0000 0.9874 0.9498 0.8882 0.8041 0.6997 0.5777 0.4410
y3=0.5*cos(x)
y3 = 1×79
0.5000 0.4937 0.4749 0.4441 0.4021 0.3499 0.2888 0.2205
plot(x,y1,'K',x,y2,'r',x,y3,'b')
5
7E
disp("(sub plot) for different graphs in the same figure ")
disp("y1=sin(x),y2=cos(x)")
y1=sin(x),y2=cos(x)
subplot(2,2,1);
y1=sin(x)
y1 = 1×79
0 0.1585 0.3130 0.4595 0.5945 0.7144 0.8163 0.8975
plot(x,y1,'k')
subplot(2,2,4);
y2=cos(x)
y2 = 1×79
1.0000 0.9874 0.9498 0.8882 0.8041 0.6997 0.5777 0.4410
plot(x,y2,'b')
6
7