美文网首页
讲解:MA1MSP、Statistical Programmin

讲解:MA1MSP、Statistical Programmin

作者: jiniuyu | 来源:发表于2020-01-10 13:14 被阅读0次

    MA1MSP: Mathematical and Statistical ProgrammingAssignment 3This assignment counts to 10% of the total marks of this module. Full marks of thisassignment can be gained from complete answers to ALL questions and emailing theMATLAB script and function files to me at john.evans.18@nuist.edu.cn before 12pm(noon) 16th May, 2019 (Thursday).Note: For this question you should submit two MATLAB files, with the file names MSP Asgn3a StudentID.mfor part (a) and MSP Asgn3b StudentID.m for part (b), where ’StudentID’ is your Student IDnumber. Both files should be submitted together in the same email. Please include your student ID in the subject line of the email. At the beginning of the function or script, add a comment line to state ‘This is the function/script for Part (x) of Assignment 3’ where ‘x’ is ‘a’ or ‘b’. If either of the two files are missing or do not run then a mark of zero will be recorded for thatpart of the question. Marks will be deducted if students output to the command window anything that is not askedfor. By submitting your work you are confirming that the code is your own, independent work.(a) Write a function MSP Asgn3a StudentID, where ‘StudentID’ is your Student ID number. Asinput, the function takes a matrix A and a scalar m. The function should take the followingactions:If the matrix A is not square, return the error ‘Invalid input: the matrix must be square!’.Otherwise, if the input scalar m equals to 1, return the determinant of A; 2, return the trace of A; 3, return the eigenvalues of A; 4, if A is invertible (e. g., the absolute value of the determinanMA1MSP留学生作业代写、代做Statistical Programming作业、C++编程作业代写、代做c++实验作t of A is not less than 10?6),return the inverse of A. Otherwise, return the message ‘The matrix is non-invertible’; none of the above, return the error ‘Invalid input for matrix operation’.Except for the required output and error messages, the function should not write any extrainformation to the command window.[5 marks](b) Write a script MSP Asgn3b StudentID that performs the following steps:(i) Define a 2 × 2 matrix B whose elements are 1, 2 and the last two digits of your studentnumber. So, if your student number ends in the digits 34, you should define�1(ii) By calling the function from part (a),1. consider the following matrix,C = 7B ? 5Iwhere I is the 2 × 2 identity matrix. Calculate the variables x, y, where x is thedeterminant of C and y is the trace of C. Display in the command window a vectorwith entries equal to x and y;2. calculate the inverse matrix of C2 and display the output in the command window.[Note: if the function from part (a) returns an error message that the input matrixis not invertible, change one of the elements in B by either adding or subtracting 1and run the script again. Submit the script with the updated B and add a commentexplaining how the elements in B differ from the last four digits in your student IDnumber, and why.](iii) Define a 2 × 4 matrix D whose elements are the last five digits of your student number.So, if your student number ends in the digits 68310001, you should define�By calling the function from part (a), write the eigenvalues of B1D (OR an automaticallygenerated error message) to the command window.[5 marks]2转自:http://www.7daixie.com/2019051621116591.html

    相关文章

      网友评论

          本文标题:讲解:MA1MSP、Statistical Programmin

          本文链接:https://www.haomeiwen.com/subject/eubpactx.html