0 views

Uploaded by Chong Cherng Wong

coding

- Eigen Vector & Eigen Values
- hmwk2
- Linear Algebra Spring 2015
- eigen
- MATH2019 Course Problems 2012s1
- AIAA-2001-2609
- Math Course Notes-4
- Fusion Categories
- Mcqdoors Fm
- PLS Regression_a Basic Tool of Chemometrics
- shiCvpr94f
- PhysRevLett.110.028701
- Lay Matlab Manual
- j Mm 2008 Strang
- mm_r07
- Determinants and eigenvalue
- algebra lineal howar anton 2.3
- Isomorphism In Kinematic Chains
- 6676_01_msc_20100219
- WCE2011_pp1179-1183.pdf

You are on page 1of 3

SEM 2 SA 2017/2018

SAS EXERCISES 1

PROC IML;

reset print;

A={10 15,11 9, 1 -6};

B={5 2, 1 0, 10 7};

print A B; /* notice the difference between these two print commands*/

print A;

print B;

/*transpose of matrix*/

At=A`;

Bt=B`;

print At;

print Bt;

C=A+B;

D=A-b;

print A, B, C, D;

quit;

/* be careful, once you have given 'quit' command,next line should again start with proc IML!*/

/*multiplication of matrices*/

proc iml;

A={10 15,11 9, 1 -6};

B={5 2, 1 0, 10 7};

C2=A*B`; /* matrix A multiplies with matrix B transposed*/

D2=4*A;

D3=(1/3)*A;

print A, B, C2, D2, D3;

1 4 1 3

3 8 1

A 2 6 , B 1 4 , C

5 4 0

2 8 2 5

Write down your complete SAS code.

/*determinant and inverse*/

proc iml;

A={1 3 2 5,1 2 5 3,1 -1 2 2, 5 2 -1 4};

Bdet=det(A);

Cinv=inv(A);

print A, Bdet, Cinv;

quit;

/*trace of a matrix*/

proc iml;

W={1 2 3, 4 5 6, 7 8 10};

trw1=trace(W);

trw2=sum(diag(W));

print W, trw1, trw2;

/* elementwise multiplication*/

proc iml;

a={3 6, 2 1};

b={7 -4, -3 2};

ab=a#b;

print a, b, ab;

/*Kronecker Product*/

a={2 4,0 -2,3 -1};

b={5 3,2 1};

ab=a@b;

print a, b, ab;

proc iml;

A=i(3);

print A;

The first argument is the number of rows,

the second argument is the number of columns,

the last argument is the value of each element*/

newmatrix=j(2,3,4.2);

print newmatrix;

proc IML;

A={1 1 1,2 5 -1,0 1 -1};

rankA=round(trace(ginv(A)*A));

print A, rankA;

It computes the ranks of numbers in a matrix*/

C={1.2 3.5, 5.1 9.8};

rc=rank(C);

print C, rc;

4 3 2

Q2. Let B 6

5 10 .

10 1 6

(a) Are the column vectors of B linearly dependent?

(b) What is the rank of B ?

(c) Calculate the determinant of B

(d) Find the inverse of B and check that the resulting matrix is indeed the inverse.

/*compute the sum of all elements in a matrix*/

proc iml;

A={3 6,2 1};

B={7 -4,-3 2};

sumA=sum(A);

print A, sumA;

rowsumA=A[ ,+];

colsumA=A[+, ];

print A, rowsumA, colsumA;

col2=A[ ,2];

print col2;

/*select the element in the first row and the second column of A*/

a12=A[1,2];

print a12;

proc iml;

A={13 -4 2,-4 11 -2,2 -2 8};

L=eigval(A); /*compute eigenvalues of a square matrix A*/

V=eigvec(a); /*compute an n x n matrix whose columns are eigenvectors of A*/

print A, L;

print V [format=Fract.];

Q3: Let

23 0 2 3

A 0 1 0

2 3 0 1 3

(ii) Show that A is idempotent.

(iii) Show that I A is idempotent.

(iv) Show that A I A O .

(v) Find trace of matrix A .

(vi) Find the eigenvalues of A .

- Eigen Vector & Eigen ValuesUploaded bymacynthia26
- hmwk2Uploaded byEren Can Kızıldağ
- Linear Algebra Spring 2015Uploaded bysofi
- eigenUploaded byCody Sage
- MATH2019 Course Problems 2012s1Uploaded byShean Hee
- AIAA-2001-2609Uploaded byTudorel Afilipoae
- Math Course Notes-4Uploaded byFederico Pelayo
- Fusion CategoriesUploaded byAbhijeet Bhalkikar
- Mcqdoors FmUploaded byAnish Rao
- PLS Regression_a Basic Tool of ChemometricsUploaded byCamilo Pardo Macea
- shiCvpr94fUploaded bytatarasanurazvan
- PhysRevLett.110.028701Uploaded bymalbori
- Lay Matlab ManualUploaded byGraciela Marques
- j Mm 2008 StrangUploaded byjosh
- mm_r07Uploaded byandhracolleges
- Determinants and eigenvalueUploaded byA
- algebra lineal howar anton 2.3Uploaded byIrvin Sandoval
- Isomorphism In Kinematic ChainsUploaded byInternational Journal of Research in Engineering and Science
- 6676_01_msc_20100219Uploaded bylee_shee
- WCE2011_pp1179-1183.pdfUploaded byRed John
- 04484213Uploaded byShailendraPratapSingh
- Ch8.pdfUploaded by王大洋
- Learn More About Engineering MathematicsUploaded byCrystal King
- MATH1048 Linear Algebra 1 Exam 2014Uploaded bymarana77
- cdc-zai8Uploaded byRampyare Yadav
- Elasticity by Gordon C. EverstineUploaded byredjellou
- One-factor Model for Cross-correlation Matrix in the Vietnamese Stock MarketUploaded byHiển Hồ
- Analysis of the Effects of Delays on Load Sharing 1989Uploaded byAnkita Singhal
- 00-useUploaded byHank Caren Moody
- Aeroelastic Analysis of PropellersUploaded bymsrchand

- 20150407040907791.pdfUploaded byChong Cherng Wong
- CDA solutions.pdfUploaded byChong Cherng Wong
- Tutorial 8Uploaded byChong Cherng Wong
- Lecture 1Uploaded byChong Cherng Wong
- MS6215Ch5Uploaded bypraveen
- 混元站桩Uploaded byChong Cherng Wong
- Tutorial 6Uploaded byChong Cherng Wong
- 2017_13_report.pdfUploaded byChong Cherng Wong
- Tutorial 2Uploaded byChong Cherng Wong
- FormulaUploaded byChong Cherng Wong
- 123 Temu Bual InklusifUploaded byChong Cherng Wong
- Tutorial 1Uploaded byChong Cherng Wong
- An Introductory Study on Time SeriesUploaded bydstar13
- 太极功夫扇.pdfUploaded byChong Cherng Wong
- Tutorial 1 MST 562Uploaded byChong Cherng Wong
- L4Uploaded byChong Cherng Wong
- 太极功夫扇Uploaded byChong Cherng Wong
- Etika kaunselingUploaded byNanthini Dhanabalan
- IOP - Public SpeakingUploaded byChong Cherng Wong
- L1Uploaded byChong Cherng Wong
- 20162017 USM Academic CalendarUploaded byPurawin Subramaniam
- HBEF 3503 (Aktiviti 1)Uploaded byBdrul Hsham
- CONTOH KES.docxUploaded byongyennee
- usermanualIPSUSMUploaded byChong Cherng Wong
- LSP 404 - IOPUploaded byChong Cherng Wong
- 301_spd_cholesky.pdfUploaded byAn Son Dang
- 201305260552_HBEF 3503Uploaded byChong Cherng Wong
- 221956572-HBEF-3503-Aktiviti-1Uploaded byChong Cherng Wong
- 205583426-Temu-Bual-Inklusif.docUploaded bySusan Chong

- D49360GC10_TOCUploaded byRapid Chase
- Balduzzi Cybercrmine in the Deep WebUploaded by11111
- ECM Essentials_IBM FileNet CMUploaded byBiju Scaria
- Digipostpro Tech Sheet WebUploaded byphil_turbo
- Mind Control by Don WinslowUploaded bymukulagr7
- 08 NPPUploaded bymalaga45
- Machining Process Monitoring...Uploaded byoptimist5
- 28603818 List of Top Companies With CEO Name and AddressUploaded bypukazhendhi
- Working With 3D Objects and Transparencies to Make a Vector Cola Bottle DesignUploaded byAbdul Aziz
- IPPricelistInside Low ResUploaded bysudhakarkadi
- S.a.P Corporate Trainings _ List the Differences Between BW 3.5 and BI 7.0 VersionsUploaded byసుశీల్ శరత్
- HuaweiUploaded byFrank Calberg
- 13.PILL CAMERAUploaded byRaamaa Swetha
- Laudisi Enterprises Acquires Kapp & PetersonUploaded byPR.com
- Using Social Media to Your AdvantageUploaded byNugraha Budi Santosa
- Getting StartedUploaded byjayavardhankoti
- ENGD1004 EEP Lab1_2011_1Uploaded byheskey1234
- SRS Pharmacy Draft1Uploaded byIrina Gheorghe
- YSI IQ SensorNet Wastewater Process Monitoring and Control InstrumentationUploaded byPatrick Higgins
- Chapter_9_Counting-Permuations_Combinations.pdfUploaded byRiddhi Bose
- Architecture Fault Modeling and Analysis with the Error Model Annex, Version 2Uploaded bySoftware Engineering Institute Publications
- Software Defined Networking for TelecomUploaded byMouadSama
- OTDR TestingUploaded byumargakkhar
- Data SheetUploaded byRuxandra Trandafir
- step-by-step guide final 10-27-17Uploaded byapi-372426982
- Omo Winter 13 ProbsUploaded bybipasha2302_23716749
- Director or Sr. Manager Direct Mail ProductionUploaded byapi-121305934
- st_vid10714-stUploaded byBerrezeg Mahieddine
- testdrive_se.pdfUploaded bymuss21
- Key Risk Indicator TemplatesUploaded byazizurr