Introduction and Basic Opertion of Matlab

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

INTRODUCTION AND BASIC OPERTION OF

MATLAB
sqrt(8/sqrt(4+(17^2))+(8/sqrt(46+(19^2))))^9
ans = 0.5177
Question
a=5
a=5
>> x=2
x =2
>> y=9
y =9
>> val = (exp(-a)*sin(x)+10*sqrt(y))
val = 30.0061

> k=[1 2 3 ; 7 8 0; 4 5 6]
k =1 2 3
7 8 0
4 5 6

>> v=[ 10 20 30; 70 80 90; 40 50 0]

v =10 20 30
70 80 90
40 50 0
>> p=k*v

p =270 330 210


630 780 930
630 780 570
>> inv(p)
Ans=0.2889 0.0250 -0.1472
-0.2333 -0.0222 0.1222
0 0.0028 -0.0028

>> p^9
ans =1.0e+28 *

2.2278 2.7528 2.5338


6.6026 8.1586 7.5096
5.4841 6.7765 6.237

Plot
a=[1,2,3,4,5,6];
>> b=[3,-2,2,4,-2,1];
>> plot(a,b)
4

Roll No 211113009
3

-1

-2

-3

-4
1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6
ROLL NO 211113009

x=0:pi/100:2*pi;
y= sin(x);
plot(x,y)

1 ROLL NO. 211113009


0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1

0 1 2 3 4 5 6 7

ROLL NO 211113009
Vout

To Workspace
m
a
k

Diode

Discrete,
Ts = 5e-05 s.

+
powergui
AC Voltage Source +
Series RLC Branch v
-
Voltage Measurement Scope

Single Phase Half Wave Rectifier with R=09 (211113009)


120
Voltage

100

80

60

40

20

-20
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04

Time (seconds)
R=9 (211113009) L=9*10-3 (211113009)
200

0
Voltage
Input

-200
0 0.01 0.02 0.03 0.04 0.05 0.06

100
Voltage

0
Output

-100
0 0.01 0.02 0.03 0.04 0.05 0.06
20

0
Current
Output

-20
0 0.01 0.02 0.03 0.04 0.05 0.06

200
100
Voltage
Diode

0
-100
0 0.01 0.02 0.03 0.04 0.05 0.06

10
Current
Input

-10
0 0.01 0.02 0.03 0.04 0.05 0.06
Time (seconds)

You might also like