合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

        MA2552編程代寫、代做MATLAB程序

        時間:2023-12-08  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯


        MA2552 Introduction to Computing (DLI) 2023/24

        Computer Assignment 3

        1. Write a function with header [B] = myMakeLinInd(A), where A and B are matrices.

        Let the rank(A) = n, then B should be a matrix containing the first n columns of A

        that are all linearly independent.

        2. Write a function alpha = myPolyfit(n,p,x) that finds the coefficients of a polynomial p(x) of degree n that fits the data in p and x. Your function should solve this

        problem as a linear system of equations and show an error if there is either no solution

        or an infinite number of solutions.

        3. Repeat the question above but using the least square method instead. Note that now

        there is always a unique solution, independently of the length p and x. You can check

        your results with the MATLAB built-in function polyfit.

        4. Using the bisection method, write a function r = myRoots(alpha) that outputs the

        (real) roots of a polynomial whose coefficients are the elements of the (real-valued)

        array alpha. You can check your method with the MATLAB built-in function roots.

        Hint: Find the intervals of monotony by finding the roots of the derivative of the

        polynomial.

        5. The eigenvalues λ of a (square) matrix A correspond to the roots of the function

        p(λ) = det(A − λI), where I denotes the identity matrix. Explain why if A is of size

        n, then p(λ) is a polynomial of degree n. Next, using question 3 and question 4, code

        a function that finds the real eigenvalues A and their corresponding eigenvectors.

        6. The singular value decomposition of a matrix A of size n×m, is a factorisation of A in

        the form A = USV t

        , where both U and V are (full rank) (orthonormal) square matrices

        and S is a non-necessarily-square diagonal matrix whit non-negative elements. The

        non-zero elements of the diagonal of S, called singular values of A, correspond to the

        square root of the non-zero eigenvalues of AAt

        (or AtA). The matrix V is formed by the

        eigenvectors of AtA and the matrix U is formed by the eigenvectors of AAt

        . Using eig,

        implement a function [U,S,V] = mySVD(A) which computes the SVD decomposition

        of a matrix A.

        7. Note that the rank of a matrix A is given by the number of non-zero singular values of

        A (why?). Write a function that take as input a matrix A, and outputs a new matrix

        Ak, which is k-rank version of A, computed by keeping the k-largest singular values

        of A. Use this function to show a low rank version of the image of question 10 of

        Assignment 1.

        8. Find regression curves for the average runtime data T1(n) and T2(n), corresponding

        to the runtime of the code of question 10 of Assignment 2, and its efficient version,

        respectively, where n is the size of the input matrix M. Plot your regression curves along

        with the runtime data. Can you quantify now how faster is the efficient implementation

        with respect to the inefficient one?

        1

        MA2552 Introduction to Computing (DLI) 2023/24

        9. Implement a MATLAB function that take as input two arrays f and x, representing

        the values of a real valued function f(x); the array x should be evenly spaced. Your

        function should:

        (a) create a new array f_s which replace each element of f with the average of its k

        nearest neighbours (k should also be an input of your function) to the left and to

        the right. The function f_s is a way of regularising a noisy or irregular function.

        (b) returns the numerical derivative of fs using a centred first order finite difference

        scheme that you should also implement.

        Test your code with x = linspace(0,2*pi,1000)and f = sin(x) + 0.1*randn(size(x)),

        for different values of k.

        10. Write a function I = myTrapez(f, a, b, n), which computes the approximation of

        R b

        a

        f(x) dx by a trapezoidal rule: R b

        a

        f(x) dx ≈ h

        h

        f(a)+f(b)

        2 +

        Pn−1

        k=1 f(xk)

        i

        , where xk =

        a + hk, and h =

        b−a

        n

        .Your function should not use any built-in Matlab functions. Test

        your function by computing R 1

        0

        1 − x

        2 dx, with n = 10, 20, and 40. Given that the

        exact value of the integral is π/4, how does the error of the approximateresult scale

        with n?

        請加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

         

        掃一掃在手機打開當前頁
      1. 上一篇:代寫COMP3023、C/C++語言編程代做
      2. 下一篇:代寫COMP26120、代做C++, Java/Python編程
      3. 無相關信息
        合肥生活資訊

        合肥圖文信息
        出評 開團工具
        出評 開團工具
        挖掘機濾芯提升發動機性能
        挖掘機濾芯提升發動機性能
        戴納斯帝壁掛爐全國售后服務電話24小時官網400(全國服務熱線)
        戴納斯帝壁掛爐全國售后服務電話24小時官網
        菲斯曼壁掛爐全國統一400售后維修服務電話24小時服務熱線
        菲斯曼壁掛爐全國統一400售后維修服務電話2
        美的熱水器售后服務技術咨詢電話全國24小時客服熱線
        美的熱水器售后服務技術咨詢電話全國24小時
        海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
        海信羅馬假日洗衣機亮相AWE 復古美學與現代
        合肥機場巴士4號線
        合肥機場巴士4號線
        合肥機場巴士3號線
        合肥機場巴士3號線
      4. 短信驗證碼 酒店vi設計 投資移民

        關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

        Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
        ICP備06013414號-3 公安備 42010502001045

        久久久久国产精品嫩草影院| 精品国产日韩久久亚洲| 全球AV集中精品导航福利| 正在播放酒店精品少妇约| 精品国产日韩亚洲一区91| 最新国产精品好看的国产精品| 无码国产精品一区二区免费I6 | 成人h动漫精品一区二区无码| 亚洲精品二三区伊人久久| 99精品国产在热久久婷婷| 久久精品免费视频观看| 国产亚洲精品资源在线26u| 精品久人妻去按摩店被黑人按中出| 日韩精品人成在线播放| 精品日韩一区二区| 日韩成人免费在线| 亚洲AV日韩AV一区二区三曲| 无码日韩人妻AV一区二区三区| 在线观看91精品国产不卡免费| 在线视频精品一区| 精品日产卡一卡二卡三入口 | 日韩人妻无码中文字幕视频| 波多野结衣精品一区二区三区| 国产精品午夜无码av体验区| 国产精品无码专区在线播放| 最新69国产成人精品免费视频动漫| 好吊操这里只有精品| 国产精品99久久久久久人四虎| 久久蜜桃精品一区二区三区| 亚洲日韩精品国产一区二区三区 | 国产成人综合久久精品| 国产精品午夜在线播放a| 国产精品日本亚洲777| 日韩久久精品一区二区三区| 手机国产乱子伦精品视频| 国产精品白嫩在线观看| 国产精品漂亮美女在线观看| 国产精品66在线观看| 国产精品V亚洲精品V日韩精品 | 精品中文字幕一区在线| 日韩一区二区免费视频|