SlideShare a Scribd company logo
GSU 07201 TUTORIAL SHEET
General Studies Department-Computing Using Mathematical Software Module 1
1. Write a program that calculates Fabonacii series in which every number is generated by sum of
two previous terms. For example:
1 2 3 5 8 13 21 · · · n
2. The height and speed of a projectile (such as thrown ball) launches with speed v0 at an angle A
to the horizontal are given by
h(t) = v0tsinA − 0.5gt2
v(t) = v2
0 − 2v0gtsinA + g2t2
where g is the acceration due to gravity. The projectile will strike the groung when h(t) = 0, which
gives the time to hit, thit =
2v0sinA
g
. Suppose that A = 40◦
, v0 = 20ms−1
and g = 9.81ms−2
.
Use the MATLAB relational and logical operators to find the time when the height is not less
that 6m and the speed is simultaneously not greater than 16ms−1
. Note that graphical method
would be used but the accurate of the results would be limited with the ability to pick points off
the graph and it is time consuming.
3.
4. It has been said that there are two unpleasant and unavoidable facts of life in any country;
death and income tax. A very simplified version of how income tax is calculated in one of the
Africans’country is based on the following table:
Taxable income Tax payable
$10000 or less 10% of taxable income
Between $10000 and $20000 $1000+20% of amount by which taxable income exceeds $10000
More than $20000 $3000+50% of amount by which taxable income exceeds $20000
For example, the tax payable on a taxable income of $30000 is given by
$3000 + 50% of ($30000 − $20000) = $8000.
Develop a MATLAB program using loop with an elseif to calculate the income tax on the
following taxable income in dollars: 5000,15000,30000 and 50000.
5. By using if-elseif-else statement write a program to check whether a given number is greater
than or equal to 50. Test your program with numbers 23, 50 and 98.
6. Plot a bar graph to show the comparison of average temperature in the cities A, B and C for the
months from September to February of the data given in the table below:
Month City A City B City C
September 31 28 24
October 29 26 22
November 28 25 20
December 27 24 16
January 26 22 17
February 29 25 20
Label the x-axis as Months from September to February and the y-axis as Temperature in Celsius,
include the legend for cities and the title of your graph should read as Temperature of city A, B
and C for Months from September to February. Copy the codes and the graph displayed into your
answer booklet.
7. Develop a program which determines whether the given number is even or odd. The criteria
used in this programme is that the number is divided by 2 and remainder is calculated. If the
remainder is found to be equal to zero, then the number is even, otherwise the number is said to
be odd. Test your program by using 39, 2910 and 8455.
1Mbitila A.S.(Module tutor)
1
8. Prepare a MATLAB program which uses the compound if-statement which compares the age
of the students, whether it lies between 5 and 15 years. If the age is between this range, then it
printed as being permitted to appear for the contest, otherwise it is not permitted to appear for
the contest. Verify your program by using age of 3, 10 and 20.
9. Plot y = coshx and y = 0.5ex
on the same plot for for 0 ≤ x ≤ 2. Use different line types and
legend to distinguish the curves. Label the plot appropriately.
10. In meteorology, the Clausius-Clapeyron equation is employed to determine the relationship
between saturation water vapour pressure and atmospheric temperature.This is an important
component of weather prediction for irrigation purposes when the actual partial pressure of water
in the air is known. The Clausius-Clapeyron equation is
ln
P0
6.11
=
∆Hv
Rair
×
1
273
−
1
Tk
where P0
is the saturation vapour pressure for water in mbar, ∆Hv is the latent heat of vapor-
ization for water, 2.453 × 106
Jkg−1
, Rair is the gas constant for moist air, 461Jkg−1
and T is the
temperature in kelvins (K). It is rare that temperature on the surface of the earth are lower than
−60◦
F or higher than 120◦
F. The formula to convert Fahrenheit degrees into kelvin degrees (Tk)
is given by
Tk =
(Tf + 459.6)
1.8
where Tf is temperature in Fahrenheit. Use the Clausius-Clapeyron equation to find the saturation
vapour pressure in the range from −60◦
F to 120◦
F in the increment of 20◦
F. Present your results
as a table of Fahrenheit temperatures and Saturation vapour pressures. Column heading of your
table are not necessary.
11. Design a program with nested if-statement in which the price and the number of products
purchased by the customer is supplied. If the price is more than 5000 and the number of products
purchased are more that 5, then the discount is paid as 5%, otherwise if the price of the product
is less than 5000, then the discount given on products is zero. Verify the performance of your
program at three different stages: 10000 price with 15 number of items, 4000 with 20 number of
items and 250000 price and 2 number of items.
12. Consider the following square matrix
x =




4 90 85 75
2 55 65 75
3 78 82 79
1 84 92 93



.
Write down the MATLAB code to find:
(a) the maximum value in each column
(b) the row in which maximum value in (a) above occur
(c) the maximum value in each row (you will have to transpose the matrix to answer this
question)
(d) the column in which maximum value in (c) above occur
(e) the maximum value of the entire table or matrix
(f) the mean value in each column
(g) the median for each column
(h) the mean value of each row
(i) the median value for each row
(j) the mean for the entire matrix
(k) the standard deviation of each column
(l) the variance for each column
(m) the square root of variance you found for each column
13. Use the subplot command to sketch the graphs of the functions; y = e−1.2x
sin(10x + 5) for
0 ≤ x ≤ 5 and y = |x3
− 100| for −6 ≤ x ≤ 6 in the same figure.
2
14. MATLAB has overlay plot capability to create overlay plots. Use this capability to plot a variable
x = 0 : 10 : 30 against matrix
A =




4 6 8 10
2 6 10 14
1 2 3 5
18 15 12 8




15. Plot y = sinhx and y = 0.5ex
on the same plot for for 0 ≤ x ≤ 2. Use solid line type for each,
the gtext command to label the sinhx curve, the text command to label the 0.5ex
curve. Label
the plot appropriately.
16. Create a function named kubwa which should be written in a file named kubwa.m. The function
created must takes five numbers as argument and returns the maximum of the numbers.
3

More Related Content

What's hot

Monte Carlo Simulation Methods
Monte Carlo Simulation MethodsMonte Carlo Simulation Methods
Monte Carlo Simulation Methods
ioneec
 
Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...
Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...
Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...
hwbloom49
 
Basic Concepts in Mathematics
Basic Concepts in MathematicsBasic Concepts in Mathematics
Basic Concepts in Mathematics
REYBETH RACELIS
 
Auto correlation and cross-correlation
Auto correlation and cross-correlationAuto correlation and cross-correlation
Auto correlation and cross-correlation
Mrinmoy Majumder
 
rational expression
rational expressionrational expression
rational expression
rey castro
 
Programming qns
Programming qnsProgramming qns
Programming qns
Dr.Subha Krishna
 
1.4 B & 1.5 Ex 3 & 4
1.4 B & 1.5 Ex 3 & 41.4 B & 1.5 Ex 3 & 4
1.4 B & 1.5 Ex 3 & 4
Kathy Favazza
 
Matrices, Arrays and Vectors in MATLAB
Matrices, Arrays and Vectors in MATLABMatrices, Arrays and Vectors in MATLAB
Matrices, Arrays and Vectors in MATLAB
Abu Raihan Ibna Ali
 
Regression planar
Regression planarRegression planar
Regression planar
Kike Herlindo
 
Taller algoritmos cualitativos cuantitativos
Taller algoritmos cualitativos cuantitativos Taller algoritmos cualitativos cuantitativos
Taller algoritmos cualitativos cuantitativos
jamilethbosquez
 
Rt climate graph
Rt climate graphRt climate graph
Rt climate graph
jwt1991
 
Intro to the Climate graph
Intro to the Climate graphIntro to the Climate graph
Intro to the Climate graph
Richard McLaren
 
Rt climate graph
Rt climate graphRt climate graph
Rt climate graph
jwt1991
 
Inequalties Of Combined Functions2[1]
Inequalties Of Combined Functions2[1]Inequalties Of Combined Functions2[1]
Inequalties Of Combined Functions2[1]guestf0cee6
 
2 introduction to computer programming
2 introduction to computer programming2 introduction to computer programming
2 introduction to computer programming
Nataly Medina
 
Sequential circuit multiplier
Sequential circuit multiplierSequential circuit multiplier
Sequential circuit multiplier
Subhram
 
2.9 graphs of factorable rational functions t
2.9 graphs of factorable rational functions t2.9 graphs of factorable rational functions t
2.9 graphs of factorable rational functions t
math260
 

What's hot (18)

Monte Carlo Simulation Methods
Monte Carlo Simulation MethodsMonte Carlo Simulation Methods
Monte Carlo Simulation Methods
 
zero_response
zero_responsezero_response
zero_response
 
Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...
Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...
Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...
 
Basic Concepts in Mathematics
Basic Concepts in MathematicsBasic Concepts in Mathematics
Basic Concepts in Mathematics
 
Auto correlation and cross-correlation
Auto correlation and cross-correlationAuto correlation and cross-correlation
Auto correlation and cross-correlation
 
rational expression
rational expressionrational expression
rational expression
 
Programming qns
Programming qnsProgramming qns
Programming qns
 
1.4 B & 1.5 Ex 3 & 4
1.4 B & 1.5 Ex 3 & 41.4 B & 1.5 Ex 3 & 4
1.4 B & 1.5 Ex 3 & 4
 
Matrices, Arrays and Vectors in MATLAB
Matrices, Arrays and Vectors in MATLABMatrices, Arrays and Vectors in MATLAB
Matrices, Arrays and Vectors in MATLAB
 
Regression planar
Regression planarRegression planar
Regression planar
 
Taller algoritmos cualitativos cuantitativos
Taller algoritmos cualitativos cuantitativos Taller algoritmos cualitativos cuantitativos
Taller algoritmos cualitativos cuantitativos
 
Rt climate graph
Rt climate graphRt climate graph
Rt climate graph
 
Intro to the Climate graph
Intro to the Climate graphIntro to the Climate graph
Intro to the Climate graph
 
Rt climate graph
Rt climate graphRt climate graph
Rt climate graph
 
Inequalties Of Combined Functions2[1]
Inequalties Of Combined Functions2[1]Inequalties Of Combined Functions2[1]
Inequalties Of Combined Functions2[1]
 
2 introduction to computer programming
2 introduction to computer programming2 introduction to computer programming
2 introduction to computer programming
 
Sequential circuit multiplier
Sequential circuit multiplierSequential circuit multiplier
Sequential circuit multiplier
 
2.9 graphs of factorable rational functions t
2.9 graphs of factorable rational functions t2.9 graphs of factorable rational functions t
2.9 graphs of factorable rational functions t
 

Similar to MATLAB review questions 2014 15

Matlab solved tutorials 2017 june.
Matlab solved tutorials  2017 june.Matlab solved tutorials  2017 june.
Matlab solved tutorials 2017 june.
musadoto
 
Environmental Engineering Assignment Help
Environmental Engineering Assignment HelpEnvironmental Engineering Assignment Help
Environmental Engineering Assignment Help
Matlab Assignment Experts
 
Travaux Pratique Matlab + Corrige_Smee Kaem Chann
Travaux Pratique Matlab + Corrige_Smee Kaem ChannTravaux Pratique Matlab + Corrige_Smee Kaem Chann
Travaux Pratique Matlab + Corrige_Smee Kaem Chann
Smee Kaem Chann
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
anhlodge
 
Exposure Interval Initial Risk Assessment (with exist.docx
Exposure Interval    Initial Risk Assessment (with exist.docxExposure Interval    Initial Risk Assessment (with exist.docx
Exposure Interval Initial Risk Assessment (with exist.docx
ssuser454af01
 
Turning Multivariable Models Into Interactive Animated Simulations
Turning Multivariable Models Into Interactive Animated SimulationsTurning Multivariable Models Into Interactive Animated Simulations
Turning Multivariable Models Into Interactive Animated SimulationsTom Loughran
 
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docxM166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
infantsuk
 
ENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docx
ENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docxENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docx
ENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docx
YASHU40
 
CHAPTER TENObjectiveA brief introduction of the basic concept
CHAPTER TENObjectiveA brief introduction of the basic conceptCHAPTER TENObjectiveA brief introduction of the basic concept
CHAPTER TENObjectiveA brief introduction of the basic concept
TawnaDelatorrejs
 
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
 
Laboratory 7
Laboratory 7Laboratory 7
Laboratory 7
Shafiul Omam
 
Name ____________________________Student Number ________________.docx
Name ____________________________Student Number ________________.docxName ____________________________Student Number ________________.docx
Name ____________________________Student Number ________________.docx
TanaMaeskm
 
Using the ti 83 84
Using the ti 83 84Using the ti 83 84
Using the ti 83 84
lothomas
 
Matlab intro notes
Matlab intro notesMatlab intro notes
Matlab intro notes
pawanss
 
Sheet no 1
Sheet no 1Sheet no 1
Sheet no 1
bilalkhanzada4
 
tw1979 Exercise 1 Report
tw1979 Exercise 1 Reporttw1979 Exercise 1 Report
tw1979 Exercise 1 ReportThomas Wigg
 
Pre-Calculus Midterm ExamScore ______ ______Name _______.docx
Pre-Calculus Midterm ExamScore ______  ______Name _______.docxPre-Calculus Midterm ExamScore ______  ______Name _______.docx
Pre-Calculus Midterm ExamScore ______ ______Name _______.docx
harrisonhoward80223
 
Solution of matlab chapter 6
Solution of matlab chapter 6Solution of matlab chapter 6
Solution of matlab chapter 6
AhsanIrshad8
 
ECO 520 Case Study One Production and Cost Guidelines and Rubric.docx
ECO 520 Case Study One Production and Cost Guidelines and Rubric.docxECO 520 Case Study One Production and Cost Guidelines and Rubric.docx
ECO 520 Case Study One Production and Cost Guidelines and Rubric.docx
jack60216
 
ECO 520 Case Study One Production and Cost Guidelines and Rubri.docx
ECO 520 Case Study One Production and Cost Guidelines and Rubri.docxECO 520 Case Study One Production and Cost Guidelines and Rubri.docx
ECO 520 Case Study One Production and Cost Guidelines and Rubri.docx
jack60216
 

Similar to MATLAB review questions 2014 15 (20)

Matlab solved tutorials 2017 june.
Matlab solved tutorials  2017 june.Matlab solved tutorials  2017 june.
Matlab solved tutorials 2017 june.
 
Environmental Engineering Assignment Help
Environmental Engineering Assignment HelpEnvironmental Engineering Assignment Help
Environmental Engineering Assignment Help
 
Travaux Pratique Matlab + Corrige_Smee Kaem Chann
Travaux Pratique Matlab + Corrige_Smee Kaem ChannTravaux Pratique Matlab + Corrige_Smee Kaem Chann
Travaux Pratique Matlab + Corrige_Smee Kaem Chann
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
 
Exposure Interval Initial Risk Assessment (with exist.docx
Exposure Interval    Initial Risk Assessment (with exist.docxExposure Interval    Initial Risk Assessment (with exist.docx
Exposure Interval Initial Risk Assessment (with exist.docx
 
Turning Multivariable Models Into Interactive Animated Simulations
Turning Multivariable Models Into Interactive Animated SimulationsTurning Multivariable Models Into Interactive Animated Simulations
Turning Multivariable Models Into Interactive Animated Simulations
 
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docxM166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
 
ENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docx
ENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docxENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docx
ENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docx
 
CHAPTER TENObjectiveA brief introduction of the basic concept
CHAPTER TENObjectiveA brief introduction of the basic conceptCHAPTER TENObjectiveA brief introduction of the basic concept
CHAPTER TENObjectiveA brief introduction of the basic concept
 
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
 
Laboratory 7
Laboratory 7Laboratory 7
Laboratory 7
 
Name ____________________________Student Number ________________.docx
Name ____________________________Student Number ________________.docxName ____________________________Student Number ________________.docx
Name ____________________________Student Number ________________.docx
 
Using the ti 83 84
Using the ti 83 84Using the ti 83 84
Using the ti 83 84
 
Matlab intro notes
Matlab intro notesMatlab intro notes
Matlab intro notes
 
Sheet no 1
Sheet no 1Sheet no 1
Sheet no 1
 
tw1979 Exercise 1 Report
tw1979 Exercise 1 Reporttw1979 Exercise 1 Report
tw1979 Exercise 1 Report
 
Pre-Calculus Midterm ExamScore ______ ______Name _______.docx
Pre-Calculus Midterm ExamScore ______  ______Name _______.docxPre-Calculus Midterm ExamScore ______  ______Name _______.docx
Pre-Calculus Midterm ExamScore ______ ______Name _______.docx
 
Solution of matlab chapter 6
Solution of matlab chapter 6Solution of matlab chapter 6
Solution of matlab chapter 6
 
ECO 520 Case Study One Production and Cost Guidelines and Rubric.docx
ECO 520 Case Study One Production and Cost Guidelines and Rubric.docxECO 520 Case Study One Production and Cost Guidelines and Rubric.docx
ECO 520 Case Study One Production and Cost Guidelines and Rubric.docx
 
ECO 520 Case Study One Production and Cost Guidelines and Rubri.docx
ECO 520 Case Study One Production and Cost Guidelines and Rubri.docxECO 520 Case Study One Production and Cost Guidelines and Rubri.docx
ECO 520 Case Study One Production and Cost Guidelines and Rubri.docx
 

Recently uploaded

The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 

Recently uploaded (20)

The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 

MATLAB review questions 2014 15

  • 1. GSU 07201 TUTORIAL SHEET General Studies Department-Computing Using Mathematical Software Module 1 1. Write a program that calculates Fabonacii series in which every number is generated by sum of two previous terms. For example: 1 2 3 5 8 13 21 · · · n 2. The height and speed of a projectile (such as thrown ball) launches with speed v0 at an angle A to the horizontal are given by h(t) = v0tsinA − 0.5gt2 v(t) = v2 0 − 2v0gtsinA + g2t2 where g is the acceration due to gravity. The projectile will strike the groung when h(t) = 0, which gives the time to hit, thit = 2v0sinA g . Suppose that A = 40◦ , v0 = 20ms−1 and g = 9.81ms−2 . Use the MATLAB relational and logical operators to find the time when the height is not less that 6m and the speed is simultaneously not greater than 16ms−1 . Note that graphical method would be used but the accurate of the results would be limited with the ability to pick points off the graph and it is time consuming. 3. 4. It has been said that there are two unpleasant and unavoidable facts of life in any country; death and income tax. A very simplified version of how income tax is calculated in one of the Africans’country is based on the following table: Taxable income Tax payable $10000 or less 10% of taxable income Between $10000 and $20000 $1000+20% of amount by which taxable income exceeds $10000 More than $20000 $3000+50% of amount by which taxable income exceeds $20000 For example, the tax payable on a taxable income of $30000 is given by $3000 + 50% of ($30000 − $20000) = $8000. Develop a MATLAB program using loop with an elseif to calculate the income tax on the following taxable income in dollars: 5000,15000,30000 and 50000. 5. By using if-elseif-else statement write a program to check whether a given number is greater than or equal to 50. Test your program with numbers 23, 50 and 98. 6. Plot a bar graph to show the comparison of average temperature in the cities A, B and C for the months from September to February of the data given in the table below: Month City A City B City C September 31 28 24 October 29 26 22 November 28 25 20 December 27 24 16 January 26 22 17 February 29 25 20 Label the x-axis as Months from September to February and the y-axis as Temperature in Celsius, include the legend for cities and the title of your graph should read as Temperature of city A, B and C for Months from September to February. Copy the codes and the graph displayed into your answer booklet. 7. Develop a program which determines whether the given number is even or odd. The criteria used in this programme is that the number is divided by 2 and remainder is calculated. If the remainder is found to be equal to zero, then the number is even, otherwise the number is said to be odd. Test your program by using 39, 2910 and 8455. 1Mbitila A.S.(Module tutor) 1
  • 2. 8. Prepare a MATLAB program which uses the compound if-statement which compares the age of the students, whether it lies between 5 and 15 years. If the age is between this range, then it printed as being permitted to appear for the contest, otherwise it is not permitted to appear for the contest. Verify your program by using age of 3, 10 and 20. 9. Plot y = coshx and y = 0.5ex on the same plot for for 0 ≤ x ≤ 2. Use different line types and legend to distinguish the curves. Label the plot appropriately. 10. In meteorology, the Clausius-Clapeyron equation is employed to determine the relationship between saturation water vapour pressure and atmospheric temperature.This is an important component of weather prediction for irrigation purposes when the actual partial pressure of water in the air is known. The Clausius-Clapeyron equation is ln P0 6.11 = ∆Hv Rair × 1 273 − 1 Tk where P0 is the saturation vapour pressure for water in mbar, ∆Hv is the latent heat of vapor- ization for water, 2.453 × 106 Jkg−1 , Rair is the gas constant for moist air, 461Jkg−1 and T is the temperature in kelvins (K). It is rare that temperature on the surface of the earth are lower than −60◦ F or higher than 120◦ F. The formula to convert Fahrenheit degrees into kelvin degrees (Tk) is given by Tk = (Tf + 459.6) 1.8 where Tf is temperature in Fahrenheit. Use the Clausius-Clapeyron equation to find the saturation vapour pressure in the range from −60◦ F to 120◦ F in the increment of 20◦ F. Present your results as a table of Fahrenheit temperatures and Saturation vapour pressures. Column heading of your table are not necessary. 11. Design a program with nested if-statement in which the price and the number of products purchased by the customer is supplied. If the price is more than 5000 and the number of products purchased are more that 5, then the discount is paid as 5%, otherwise if the price of the product is less than 5000, then the discount given on products is zero. Verify the performance of your program at three different stages: 10000 price with 15 number of items, 4000 with 20 number of items and 250000 price and 2 number of items. 12. Consider the following square matrix x =     4 90 85 75 2 55 65 75 3 78 82 79 1 84 92 93    . Write down the MATLAB code to find: (a) the maximum value in each column (b) the row in which maximum value in (a) above occur (c) the maximum value in each row (you will have to transpose the matrix to answer this question) (d) the column in which maximum value in (c) above occur (e) the maximum value of the entire table or matrix (f) the mean value in each column (g) the median for each column (h) the mean value of each row (i) the median value for each row (j) the mean for the entire matrix (k) the standard deviation of each column (l) the variance for each column (m) the square root of variance you found for each column 13. Use the subplot command to sketch the graphs of the functions; y = e−1.2x sin(10x + 5) for 0 ≤ x ≤ 5 and y = |x3 − 100| for −6 ≤ x ≤ 6 in the same figure. 2
  • 3. 14. MATLAB has overlay plot capability to create overlay plots. Use this capability to plot a variable x = 0 : 10 : 30 against matrix A =     4 6 8 10 2 6 10 14 1 2 3 5 18 15 12 8     15. Plot y = sinhx and y = 0.5ex on the same plot for for 0 ≤ x ≤ 2. Use solid line type for each, the gtext command to label the sinhx curve, the text command to label the 0.5ex curve. Label the plot appropriately. 16. Create a function named kubwa which should be written in a file named kubwa.m. The function created must takes five numbers as argument and returns the maximum of the numbers. 3