عدد المساهمات : 2348
نقاط : 160481
السٌّمعَة : 4
تاريخ التسجيل : 20/09/2008
العمر : 46
الموقع : www.aoua.123.st
|موضوع: Course Code: M106 Course Title: Introduction to MATLAB programming Tutor Marked Assignment- Answer Key Total Marks: 60 Contents Question1 Question2 Question3 Question4 Question5 Question6 Plagiaris الجمعة مارس 25, 2016 12:38 am|| |
Course Code: M106
Course Title: Introduction to MATLAB programming
Tutor Marked Assignment- Answer Key
Total Marks: 60
As per AOU rules and regulations, all students are required to submit their own TMA work and avoid plagiarism. The AOU has implemented sophisticated techniques for plagiarism detection. You must provide all references in case you use and quote another person's work in your TMA. You will be penalized for any act of plagiarism as per the AOU's rules and regulations.
Declaration of No Plagiarism by Student (to be signed and submitted by student with TMA work):
I hereby declare that this submitted TMA work is a result of my own efforts and I have not plagiarized any other person's work. I have provided all references of information that I have used and quoted in my TMA work.
Name of Student:
This TMA covers chapters 1, 2, 3, 4 and 5. It consists of six questions and each question is worth 10 marks. Please solve each question in the space provided. You should give the details of your solutions and not just the final results. You must submit your matlab code as a .m matlab function well commented. Also you must submit all figures and relevant plots as part of your work as a single file.
Question 1: 10 Marks
Without using the mean built-in function, do the following:
a) Write a MATLAB function my_average that takes a vector (an array) of values and returns the average (mean) value of this vector.
b) Write a MATLAB program that asks the user to enter a vector of values and generates another vector containing only values greater than the average of the input vector.
Question 2: 10 Marks
Supposing that the annual gain of a company is 8% of its social capital and it is added every year
to the company's capital. The program should produce the output same as the in the figure.
Write a MATLAB Program that:
a) prompts the user to enter the initial social capital of the company in kilo Saudi Riyal.
b) prompts the user to enter the number of years (N)
c) Saves the N annual gains in vector named ann_gain
- Saves the annual social capitals in a vector named ann_cap
- Displays the Final social capital after N years
Question 3: 10 Marks
The table below presents some of MATLAB builtin functions, for each one of them write a short description of the function and show one example how to implement each one.
Function name Description Example of implementation
Question 4: 10 Marks
Plot the following functions as a separate plot (one figure for each plot) first, then as a subplot all together
(a) y = 3x+2 with x = 0, 0.25, 0.5, ...., 7.75, 8
(b) y = e(-x2) with x = 0, 0.1, 0.2, ..., 2
(c) y = cos(x) with x = 0,pi/10,2*pi/10, ..., 2*pi
(d) y = (ln(e(x)))-1 with x = 1, 1.5, 2, ..., 4
Question 5: 10 Marks
A twin primes is a pair of prime numbers such that the difference between them is 2 (for example, 17 and 19). Write a computer program that finds all the twin primes between 10 and 500. The program displays the results in a two-column matrix in which each row is a twin prime.
“You are allowed to use primes MATLAB command to generate the prime’s numbers “.
Question 6: 10 Marks
Consider the command window outputs shown below. Write a MATLAB program that executes this output:
“Do not type individual elements explicitly “
حلول جميع الواجبات
موبايل – واتس أب
حلول مضمونة لجميع الواجبات ومشاريع التخرج
حلول الواجبات غير مكررة ونسبة التشابه أقل من 10%