SlideShare uma empresa Scribd logo
1 de 2
Baixar para ler offline
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.

Mais conteúdo relacionado

Semelhante a 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.pptxakshatraj875
 
MATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfMATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfahmed8651
 
An Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersAn Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersMurshida ck
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabBilawalBaloch1
 
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 .docxandreecapon
 
COMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptxCOMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptximman gwu
 
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 projectsMukesh Kumar
 
Matlab-free course by Mohd Esa
Matlab-free course by Mohd EsaMatlab-free course by Mohd Esa
Matlab-free course by Mohd EsaMohd Esa
 
Matlab practice
Matlab practiceMatlab practice
Matlab practiceZunAib Ali
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functionsjoellivz
 
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.docxgilpinleeanna
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxDevaraj Chilakala
 

Semelhante a 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
 

Último

Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 

Último (20)

Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 

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.