Labno 1
Labno 1
1. B=[60:0.1:70]
Answer:
B=
Columns 1 through 8
Columns 9 through 16
Columns 17 through 24
Columns 25 through 32
Columns 33 through 40
Columns 41 through 48 64.0000 64.1000 64.2000 64.3000 64.4000 64.5000 64.6000 64.7000
Columns 49 through 56
Columns 57 through 64
Columns 65 through 72
Columns 73 through 80
Columns 81 through 88
Y= V*G H=
Ans; 2 3 4 6
V= 5 4 3 5
3 3 3 6 7 8 3
4 4 4 8 7 4 8
5 5 5
G= 4. K=eye(3)
3 5 6 ans;
3 8 9 K=
9 5 4 1 0 0
Y= 0 1 0
45 54 57 0 0 1
60 72 76
75 90 95
9.
p_derivative=polyder([2, 3, 1]);
roots_p =
-1.0000
-0.5000
>> roots_q
roots_q =
3.0000
2.0000
>> product
product =
2 -7 -2 13 6
>> p_minus1
p_minus1 =
12
>> p_derivative
p_derivative =
4 3
>> q_derivate
>> q_derivative
q_derivative =
2 -5
Sol: y1=sin(x);
>> y2=sin(2*x);
>> y3=sin(4*x);
>> y4=sin(8*x);
>> subplot(2,2,1)
>> plot(x,y1)
>> subplot(2,2,2)
>> plot(x,y2)
>> subplot(2,2,3)
>> plot(x,y3)
>> title('subplot:3:sin(4x)')
>> subplot(2,2,4)
>> plot(x,y4)
11.Define a vector of cos values and a vector of polynomial values.Plot the polynomial in the first
subplot and cos wave in the second subplot.Create a third subplot that spans the lower half of the figure
and plot both vectors together.
Sol: x=linspace(-3.8,3.8);
>> y_cos=cos(x);
>> y_poly=1-x.^2./2+x.^4./24;
>> subplot(2,2,1);
>> plot(x,y_cos);
>> subplot(2,2,2);
>> plot(x,y_poly,'g');
>> title('Subplot 2:polynomial')
>> subplot(2,2,[3,4]);
>> plot(x,y_cos,'b',x,y_poly,'g');