首页 > > 详细

Ghostwriter R Programming Assignment,RAssignment Ghostwriter,Ghostwriter RAssignment,RAssignment Gh

MAE20002 Digital and Data Systems – Portfolio Tasks Description This document contains description for the following tasks:
Pass Task 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
Credit Task 1, 2, 3, 4, 5
Distinction Task 1, 2
High Distinction Task 1

Please refer to the document of Assessment Criteria available on Blackboard for
details on how your portfolio will be assessed.
MAE20002 Digital and Data Systems – Portfolio Tasks Description
The following tasks are advised to complete in week 2 and submit to get feedback
and sign off in week 3.
 Pass Tasks 1, 2, 3

Topics covered: MATLAB basics

The tasks are designed to teach you:
 To think in terms of matrices and vectors because this is how MATLAB
organizes data. You will find that complicated operations can often be
done with one or two lines of code if you use appropriate functions and
have the data stored in an appropriate structure;
 To use help to learn about new functions. The names of the functions you’ll
need to look up are provided in bold where needed;

Solution format: Copy the text from your scripts and paste it into a document. If a
question asks you to plot or display something to the screen, also include the plot
and screen output your code generates. Once you have discussed your solution
with your tutor, and corrected any issues, your work will sign off as completed.
You can then include your solution to the tasks in your portfolio.

Pass Task 1 – Creating Variables and Expressions
For all the problems in this task, write a script. called PassTask1.m and put all the
commands in it. Separate and label different problems using comments.
1. Scalar variable. Create the following variables
1) a  15
2) b  2.11025
3) c  2  3i, where i is the imaginary number
4) d  e j 2 /3, where j is the imaginary number and e is Euler’s number (use exp, pi)

2. Vector variables. Create the following variables
3)  5 4 .8 - 4 .8 - 5c V e c  , (all the numbers from 5 to -5 in increments of -0.2)
4) 0 0 .0 1 0 .9 9 11 0 1 0 1 0 1 0d V e c  , (logarithmically spaced numbers
between 1 and 10, use logspace, make sure you get the length right!)
5) !e V e c H e llo S w in b u r n e (eVec is a string, which is a vector of characters)


MAE20002 Digital and Data Systems – Portfolio Tasks Description

2017, Maryam Rahou, Page 3 of 28

3. Matrix variables. Create the following variables
1) 3 3
3 3
a M a t

a 6x6 matrix full of 3’s (use ones or zeros)
2)
1 1 1 91
2 1 2 9 2

1 0 20 10 0
b M a t




a 10x10 matrix where the vector 1:100 runs down the
columns (use reshape)
3)
1 2 3 1 2 3
4 5 6 4 5 6
1 2 3 1 2 3
4 5 6 4 5 6
c M a t




, use concatenation based on 1 2 3
4 5 6
to create this
matrix
4) 1 2 - 2 3
4 8 -9d M a t  

5) Create eMat be a 5x3 matrix of random integers with values on the range -3 to 3.
Use rand and floor or ceil and the following example on rand:
Example: Generate values from the uniform. distribution on the interval [a, b].
r = a + (b-a).*rand(100,1);

4. Scalar equations. Using the variables created in 1, calculate x, y, and z and show the
results.
1)
( ( 10 )/6 )21 ax e  

2) 3()y a b , recall that 1/hh bb , and use sqrt
3) l o g ( R e [( ) ( ) ] s i n ( / 5 ) )2c d c d az cc  , where Re indicates the real part of the
complex number in brackets, c is the complex conjugate of c, and log is the natural
log (use real, conj, log)

5. Vector equations. Using the variables created in 2, solve the equations below,
elementwise and show the results. For example, in part 1), the first element of xVec
should just be the function evaluated at the value of cVec: 22
1 / 2 .51 212 2 .5 cVecx V e c e 
,
and similarly for all the other elements so that xVec and cVec have the same size. Use
the elementwise operators: .*, ./, .^.
1) 22/ 2 .5
2
12 2 .5 cVecx V e c e 
2) 22()Ty V e c a V e c b V e c, aVecT indicates the transpose of aVec.
MAE20002 Digital and Data Systems – Portfolio Tasks Description

2017, Maryam Rahou, Page 4 of 28

3) 10lo g (1 / )zV e c d V e c , remember log10 is the log base 10, so use log10.

6. Matrix equations. Using the variables created in 2 and 3, solve the equations below and
show the results. Use matrix operators.
1) 2()x M a t a V e c b V e c a M a t  
2) yM at bV ec aV ec, note that this is not the same as aVec bVec
3) | | ( ) Tz M a t a M a t b V e c a V e c, where ||aMat is the determinant of aMat, and T
again indicates the transpose (use det).

7. Indexing
1) Assess the second column elements of cMat.
2) Replace the top row of dMat with [1 1 1].
3) Show the vector created by the command B=0:15:65
4) Create the vector LVec=[1 2 ⋯ 20] (the integers from 1 to 20), and then make
every other value in it negative to get LVec=[1 -2 3 -4 ⋯ -20].

8. Common functions
1) Make bSum the column-wise sum of bMat. The answer should be a row vector (use
sum).
2) Make cMean the mean across the rows of cMat. The answer should be a column
(use mean).
3) Make cSub the submatrix of cMat that only contains rows 2 through 4 and column 3
through 5.
4) Find the maximum value of cMat(4,:) and its first corresponding index (use max).
5) Make r a 1x5 vector using rand. Find the elements that have values = 0)
result = result + v
end
end
disp(v);
disp('The sum of the positive elements in v is: '),disp(result);


1) Run the program and correct any syntax errors.
2) Using the MATLAB Editor, set breakpoint at the lines with the statements:
for k = 1:1:length(v)
result = result + v
3) Debug the program by stepping through the program and watching the workspace
and command window for incorrect behaviour. Correct any logic errors. Reset the
breakpoints if necessary and rerun the corrected script. watching the workspace and
command window.
4) Correct any style. errors and comment on the errors.
Show the correct program and explain the errors you found in the original program.

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!