SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
Name:
Reg. No.:
END TERM EXAMINATION - JANUARY 2022
SEMESTER-I
(M.Sc.)
Subject Code: 21MAMS106 Duration: 3 hours
Subject: Computer Programming using Max. Marks: 100
MATLAB
Instructions
• All Questions are compulsory
• The Question paper consists of 2 sections - Part A contains 10 questions of 2 marks
each. Part B consists of 5 questions of 16 marks each.
• There is no overall choice. Only Part B question include internal choice.
PART - A
(2 * 10 = 20 Marks)
1. What are the types of loops does MATLAB provides?
2. What is the output of the following code?
A=[1 2 3..
];
3. Which command is used to clear the workspace?
4. Which command will give the square of elements of A = [1 3 5 7]?
5. Write short note on Workspace.
6. Distinguish between array multiplication and matrix multiplication.
7. Summarize the main difference between Scripts and Functions.
8. List out the Relational Operators.
9. What is the error in the following code
x = −1 : 0.1 : 1; y = −10 : 2 : 10; plot(x, y)
10. What are basic conditional statements available in MATLAB?
PART - B
(16 * 5 = 80 Marks)
11. (a) (i) Solve the following system of linear equations with MATLAB in both
ways:
x + y − z = 5; −x − y = 3; y + z = 4.
(ii) Create a 3 × 4 matrix A in which all the elements are 1, and create a
2 × 2 matrix B in which all the elements are 5. Then, add elements to
the matrix A by appending the matrix B such that A will be:
A =






1 1 1 0 0
1 1 1 0 0
1 1 1 0 0
0 0 0 5 5
0 0 0 5 5






OR
(b) What are different major tools within or accessible from the desktop in MAT-
LAB and explain each tool.
12. (a) If
A =


1 2 −1
0 1 1
1 −4 −7


then, write the commands
(i) to extract the sub-matrix with last two-columns of matrix A.
(ii) to delete the second column of matrix A.
(iii) to interchange the rows 1 and 2, of matrix A.
(iv) to find the size of the matrix A.
(v) to extract the diagonal of matrix A.
OR
(b) For matrix
A =


1 4 0
3 −1 −9
0 12 8


Execute the following:
(i)A(2, 1) (ii) A(1, :) = [] (iii) B = A([2, 3], [1, 2])
(iv) C = A([3 1 2], :) (v)A(end : −1 : 1, end)
13. (a) Using a nested for loop, write a MATLAB code to display all the prime num-
bers from 1 to 100.
OR
(b) Using While loop, write a MATLAB Code to calculate factorial (n); n is an
integer. Hence find factorial (7).
14. (a) If f1(x) = x3
− 2x2
+ 12x − 4 and f2(x) = 2x3
− x2
+ 5x − 3, then evaluate
2f1(x) + 4f2(x) on [0, 4]. Also, plot the output.
OR
(b) Determine the real roots of g(x) = x5
− 3x4
− 10x3
+ 27x2
+ 10x − 24 and then
plot the polynomial over the appropriate interval to verify that the polynomial
crosses the x-axis at the real root locations.
15. (a) Discuss in detail the Debugging process.
OR
(b) (i) Write a MATLAB code for plotting the functions y1 = 2e−2x
, y2 =
cos x − sin 3x on the interval [0, 5π] with step size π/10.
(ii) Determine the number of consecutive integer numbers which when added
together will give a value equal to or just less than 210.

Contenu connexe

Similaire à MSc_I_Sem_End_Sem_Paper_1.pdf

2.Exploration with CAS-I.Lab2.pptx
2.Exploration with CAS-I.Lab2.pptx2.Exploration with CAS-I.Lab2.pptx
2.Exploration with CAS-I.Lab2.pptx
akshatraj875
 
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docxMATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
andreecapon
 
More instructions for the lab write-up1) You are not obli.docx
More instructions for the lab write-up1) You are not obli.docxMore instructions for the lab write-up1) You are not obli.docx
More instructions for the lab write-up1) You are not obli.docx
gilpinleeanna
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptx
Devaraj Chilakala
 

Similaire à MSc_I_Sem_End_Sem_Paper_1.pdf (20)

2.Exploration with CAS-I.Lab2.pptx
2.Exploration with CAS-I.Lab2.pptx2.Exploration with CAS-I.Lab2.pptx
2.Exploration with CAS-I.Lab2.pptx
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
MATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfMATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdf
 
Matlab booklet
Matlab bookletMatlab booklet
Matlab booklet
 
An Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersAn Introduction to MATLAB for beginners
An Introduction to MATLAB for beginners
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
sol43.pdf
sol43.pdfsol43.pdf
sol43.pdf
 
presentation.pptx
presentation.pptxpresentation.pptx
presentation.pptx
 
Ss matlab solved
Ss matlab solvedSs matlab solved
Ss matlab solved
 
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docxMATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
 
Matlab
MatlabMatlab
Matlab
 
COMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptxCOMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptx
 
A complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsA complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projects
 
Matlab-free course by Mohd Esa
Matlab-free course by Mohd EsaMatlab-free course by Mohd Esa
Matlab-free course by Mohd Esa
 
Matlab practice
Matlab practiceMatlab practice
Matlab practice
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functions
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
More instructions for the lab write-up1) You are not obli.docx
More instructions for the lab write-up1) You are not obli.docxMore instructions for the lab write-up1) You are not obli.docx
More instructions for the lab write-up1) You are not obli.docx
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptx
 
Matlab
MatlabMatlab
Matlab
 

Dernier

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Dernier (20)

FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 

MSc_I_Sem_End_Sem_Paper_1.pdf

  • 1. Name: Reg. No.: END TERM EXAMINATION - JANUARY 2022 SEMESTER-I (M.Sc.) Subject Code: 21MAMS106 Duration: 3 hours Subject: Computer Programming using Max. Marks: 100 MATLAB Instructions • All Questions are compulsory • The Question paper consists of 2 sections - Part A contains 10 questions of 2 marks each. Part B consists of 5 questions of 16 marks each. • There is no overall choice. Only Part B question include internal choice. PART - A (2 * 10 = 20 Marks) 1. What are the types of loops does MATLAB provides? 2. What is the output of the following code? A=[1 2 3.. ]; 3. Which command is used to clear the workspace? 4. Which command will give the square of elements of A = [1 3 5 7]? 5. Write short note on Workspace. 6. Distinguish between array multiplication and matrix multiplication. 7. Summarize the main difference between Scripts and Functions. 8. List out the Relational Operators. 9. What is the error in the following code x = −1 : 0.1 : 1; y = −10 : 2 : 10; plot(x, y) 10. What are basic conditional statements available in MATLAB? PART - B (16 * 5 = 80 Marks) 11. (a) (i) Solve the following system of linear equations with MATLAB in both ways: x + y − z = 5; −x − y = 3; y + z = 4. (ii) Create a 3 × 4 matrix A in which all the elements are 1, and create a 2 × 2 matrix B in which all the elements are 5. Then, add elements to the matrix A by appending the matrix B such that A will be: A =       1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 0 0 0 5 5 0 0 0 5 5       OR (b) What are different major tools within or accessible from the desktop in MAT- LAB and explain each tool. 12. (a) If A =   1 2 −1 0 1 1 1 −4 −7   then, write the commands (i) to extract the sub-matrix with last two-columns of matrix A. (ii) to delete the second column of matrix A. (iii) to interchange the rows 1 and 2, of matrix A. (iv) to find the size of the matrix A. (v) to extract the diagonal of matrix A. OR (b) For matrix A =   1 4 0 3 −1 −9 0 12 8   Execute the following: (i)A(2, 1) (ii) A(1, :) = [] (iii) B = A([2, 3], [1, 2]) (iv) C = A([3 1 2], :) (v)A(end : −1 : 1, end) 13. (a) Using a nested for loop, write a MATLAB code to display all the prime num- bers from 1 to 100. OR (b) Using While loop, write a MATLAB Code to calculate factorial (n); n is an integer. Hence find factorial (7). 14. (a) If f1(x) = x3 − 2x2 + 12x − 4 and f2(x) = 2x3 − x2 + 5x − 3, then evaluate 2f1(x) + 4f2(x) on [0, 4]. Also, plot the output. OR
  • 2. (b) Determine the real roots of g(x) = x5 − 3x4 − 10x3 + 27x2 + 10x − 24 and then plot the polynomial over the appropriate interval to verify that the polynomial crosses the x-axis at the real root locations. 15. (a) Discuss in detail the Debugging process. OR (b) (i) Write a MATLAB code for plotting the functions y1 = 2e−2x , y2 = cos x − sin 3x on the interval [0, 5π] with step size π/10. (ii) Determine the number of consecutive integer numbers which when added together will give a value equal to or just less than 210.