1 views

Uploaded by Muhammad Bilal Junaid

Lab1

- License
- 05 Ramadan Generic Cata 2017
- BTS3900 V100R012C10SPC100 (ENodeB, TDD) Differentiated Baseline Paramete...
- 4G HUA 60 NCL MODE CHANGE 20170110.xlsx
- Histogram
- CE cogestion.txt
- S1P1_Yachen_Wang.pptx
- 23216 870 Intraumts Srvcc
- 295302452-Reserved-Parameter-List.xls
- 279392594 SCCPCH Concept Implementation
- Lab1
- Lab Manual 1
- LAB 3
- Time Table
- Assignment Opt
- Assignment 2
- ADSP Lec 01
- Lab7
- Assignment1_2.pdf
- Israr q22(Publish)

You are on page 1of 2

LAB#1

Name: __________

Section: _____

Reg #:_______

Q.1 Run the MATLAB help desk by typing helpdesk. The help desk provides a hypertext

interface to the MATLAB documentation.

Q.2 Use MATLAB as a calculator. Try the following:

pi*pi - 10

sin(pi/4)

ans 2 %<--- "ans" holds the last result

x = sin( pi/5 );

cos( pi/5 ) %<--- assigned to what?

y = sqrt( 1 - x*x )

ans

Q.4 Complex numbers are natural in MATLAB. The basic operations are supported. Try

the following:

z = 3 + 4i, w = -3 + 4j

real(z), imag(z)

abs([z,w]) %<-- Vector constructor

conj(z+w)

angle(z)

exp( j*pi )

exp(j*[ pi/4, 0, -pi/4 ])

Q.5 Make sure that you understand the colon notation. In particular, explain in words

what the following MATLAB code will produce.

jkl = 0 : 6

jkl = 2 : 4 : 17

jkl = 99 : -1 : 88

ttt = 2 : (1/9) : 4

tpi = pi * [ 0:0.1:2 ];

Q.6 Extracting and/or inserting numbers into a vector is very easy to do. Consider the

following definition of xx:

xx = [ zeros(1,3), linspace(0,1,5), ones(1,4) ]

xx(4:6)

size(xx)

length(xx)

xx(2:2:length(xx)

Explain the results echoed from the last four lines of the above code.

Q.7

yy = xx; yy(4:6) = pi*(1:3)

Now write a statement that will take the vector xx defined in part (b) and replace the even

indexed elements (i.e., xx(2), xx(4), etc) with the constant . Use a vector replacement, not a

loop.

Q.8 Enter the following in MATLAB.

2

A=

6

3

,B=

4

1

6

6

2

Q.9 writes the code of following.

1. Generate a 6x6 matrix A

2. Generate a 6x1 matrix z

3. Solve linear system of equations Ax=z

4. Compute determinant of matrix A

5. Extract a 4x4 matrix from the 6x6 matrix and 4x1 matrixes from 6x1

Checked by: ________________________ Date: ______________

Marks Awarded: ____________

Comments:

- LicenseUploaded byKuracha Polarao
- 05 Ramadan Generic Cata 2017Uploaded byMuhammad Bilal Junaid
- BTS3900 V100R012C10SPC100 (ENodeB, TDD) Differentiated Baseline Paramete...Uploaded byMuhammad Bilal Junaid
- 4G HUA 60 NCL MODE CHANGE 20170110.xlsxUploaded byMuhammad Bilal Junaid
- HistogramUploaded byMuhammad Bilal Junaid
- CE cogestion.txtUploaded byMuhammad Bilal Junaid
- S1P1_Yachen_Wang.pptxUploaded byMuhammad Bilal Junaid
- 23216 870 Intraumts SrvccUploaded bybadass
- 295302452-Reserved-Parameter-List.xlsUploaded byMuhammad Bilal Junaid
- 279392594 SCCPCH Concept ImplementationUploaded byMuhammad Bilal Junaid
- Lab1Uploaded byMuhammad Bilal Junaid
- Lab Manual 1Uploaded byMuhammad Bilal Junaid
- LAB 3Uploaded byMuhammad Bilal Junaid
- Time TableUploaded byMuhammad Bilal Junaid
- Assignment OptUploaded byMuhammad Bilal Junaid
- Assignment 2Uploaded byMuhammad Bilal Junaid
- ADSP Lec 01Uploaded byShoaib Malik
- Lab7Uploaded byMuhammad Bilal Junaid
- Assignment1_2.pdfUploaded byMuhammad Bilal Junaid
- Israr q22(Publish)Uploaded byMuhammad Bilal Junaid
- Lec 13 Newton Raphson MethodUploaded byMuhammad Bilal Junaid
- Lec28 DgtlComm F13 V1Uploaded byMuhammad Bilal Junaid
- Lec 15 Summary of Single Var MethodsUploaded byMuhammad Bilal Junaid
- Lec 26 Simplex MethodUploaded byMuhammad Bilal Junaid
- Lec 25 Linear ProgrammingUploaded byMuhammad Bilal Junaid
- Lec 24 Lagrange MultiplierUploaded byMuhammad Bilal Junaid
- Lec 22 - 23 KKT ConditionsUploaded byMuhammad Bilal Junaid
- Lec 21 Marquardt MethodUploaded byMuhammad Bilal Junaid
- lec 18 unidirectional search.pdfUploaded byMuhammad Bilal Junaid