{"id":256,"date":"2026-05-17T22:34:37","date_gmt":"2026-05-17T14:34:37","guid":{"rendered":"https:\/\/xifyun.online\/?p=256"},"modified":"2026-05-17T22:55:01","modified_gmt":"2026-05-17T14:55:01","slug":"3-%e5%b1%82%e6%ac%a1%e5%88%86%e6%9e%90%e6%b3%95%e7%9a%84matlib-%e4%bb%a3%e7%a0%81%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/xifyun.online\/index.php\/2026\/05\/17\/3-%e5%b1%82%e6%ac%a1%e5%88%86%e6%9e%90%e6%b3%95%e7%9a%84matlib-%e4%bb%a3%e7%a0%81%e5%ae%9e%e7%8e%b0\/","title":{"rendered":"3.\u5c42\u6b21\u5206\u6790\u6cd5\u7684matlib \u4ee3\u7801\u5b9e\u73b0"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">                      <strong>\u4e00\u81f4\u6027\u68c0\u9a8c\u4ee3\u7801\u5b9e\u73b0<\/strong><\/p>\n\n\n\n<!DOCTYPE html>\n<html lang=\"zh-CN\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>\u5c42\u6b21\u5206\u6790\u6cd5 &#8211; \u4e00\u81f4\u6027\u68c0\u9a8c\u4ee3\u7801<\/title>\n    <style>\n        *{\n            margin: 0;\n            padding: 0;\n            box-sizing: border-box;\n            font-family: \"Microsoft Yahei\",sans-serif;\n        }\n        body{\n            background-color: #f0f4f9;\n            padding: 30px;\n        }\n        .box{\n            max-width: 900px;\n            margin: 0 auto;\n            background: #fff;\n            padding: 25px;\n            border-radius: 12px;\n            box-shadow: 0 2px 15px rgba(0,0,0,0.08);\n        }\n        h2{\n            color: #2c3e50;\n            margin-bottom: 20px;\n            text-align: center;\n            font-size: 20px;\n        }\n        .code-wrap{\n            background-color: #282c34;\n            padding: 20px;\n            border-radius: 8px;\n            margin-bottom: 20px;\n            overflow-x: auto;\n        }\n        pre{\n            color: #abb2bf;\n            white-space: pre-wrap;\n            line-height: 1.6;\n            font-size: 14px;\n        }\n        .copy-btn{\n            display: block;\n            width: 120px;\n            height: 40px;\n            border: none;\n            background-color: #3498db;\n            color: #fff;\n            font-size: 15px;\n            border-radius: 6px;\n            cursor: pointer;\n            transition: all 0.3s;\n            margin: 0 auto;\n        }\n        .copy-btn:hover{\n            background-color: #2980b9;\n        }\n        .tip-text{\n            text-align: center;\n            margin-top: 15px;\n            color: #666;\n            height: 20px;\n        }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"box\">\n        <h2>\u5224\u65ad\u77e9\u9635\u4e00\u81f4\u6027\u68c0\u9a8cMATLAB\u4ee3\u7801<\/h2>\n        <div class=\"code-wrap\">\n<pre id=\"codeText\">% \u5224\u65ad\u77e9\u9635\u4e00\u81f4\u6027\u68c0\u9a8c\u811a\u672c\nA = input(\"\u5224\u65ad\u77e9\u9635A=\");\n[n,n] = size(A);\nV = eig(A);\nMax_eig = max(V);\n\n% \u968f\u673a\u4e00\u81f4\u6027\u6307\u6807RI\u8868\nRI = [0, 0.0001, 0.52, 0.89, 1.12, 1.26, 1.41, 1.46, 1.49, 1.52, 1.54, 1.56, 1.58, 1.59];\nCI = (Max_eig - n) \/ (n - 1);\nCR = CI \/ RI(n);\n\ndisp(\"\u4e00\u81f4\u6027\u6307\u6807CI=\");\ndisp(CI);\ndisp(\"\u4e00\u81f4\u6027\u6bd4\u7387CR=\");\ndisp(CR);\n\nif CR < 0.10\n    disp(\"CR<0.10\uff0c\u8be5\u5224\u65ad\u77e9\u9635\u4e00\u81f4\u6027\u53ef\u4ee5\u63a5\u53d7\");\nelse\n    disp(\"CR\u22650.10\uff0c\u8be5\u5224\u65ad\u77e9\u9635\u4e00\u81f4\u6027\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u77e9\u9635\u9700\u4fee\u6539\");\nend<\/pre>\n        <\/div>\n        <button class=\"copy-btn\" onclick=\"copyCode()\">\u4e00\u952e\u590d\u5236\u4ee3\u7801<\/button>\n        <div class=\"tip-text\" id=\"tip\"><\/div>\n    <\/div>\n\n    <script>\n        function copyCode(){\n            const text = document.getElementById('codeText').innerText;\n            navigator.clipboard.writeText(text).then(()=>{\n                tip.innerText = '\u2705 \u590d\u5236\u6210\u529f';\n            }).catch(()=>{\n                let textarea = document.createElement('textarea');\n                textarea.value = text;\n                document.body.appendChild(textarea);\n                textarea.select();\n                document.execCommand('copy');\n                document.body.removeChild(textarea);\n                tip.innerText = '\u2705 \u590d\u5236\u6210\u529f';\n            })\n            setTimeout(()=>tip.innerText='',2000)\n        }\n    <\/script>\n<\/body>\n<\/html>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><strong>\u5e38\u7528\u7684\u52a0\u6743\u5e73\u5747\u6570\u8ba1\u7b97\u6743\u91cd\u4ee3\u7801\u5b9e\u73b0                  (\u6700\u540e\u662f\u4f7f\u7528\u4e09\u79cd\u65b9\u6cd5\u7684\u5e73\u5747\u503c)<\/strong><\/p>\n\n\n\n<!DOCTYPE html>\n<html lang=\"zh-CN\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>\u5c42\u6b21\u5206\u6790\u6cd5 - \u6743\u91cd\u8ba1\u7b97\u4ee3\u7801<\/title>\n    <style>\n        *{\n            margin: 0;\n            padding: 0;\n            box-sizing: border-box;\n            font-family: \"Microsoft Yahei\",sans-serif;\n        }\n        body{\n            background-color: #f0f4f9;\n            padding: 30px;\n        }\n        .box{\n            max-width: 900px;\n            margin: 0 auto;\n            background: #fff;\n            padding: 25px;\n            border-radius: 12px;\n            box-shadow: 0 2px 15px rgba(0,0,0,0.08);\n        }\n        h2{\n            color: #2c3e50;\n            margin-bottom: 20px;\n            text-align: center;\n            font-size: 20px;\n        }\n        .code-wrap{\n            background-color: #282c34;\n            padding: 20px;\n            border-radius: 8px;\n            margin-bottom: 20px;\n            overflow-x: auto;\n        }\n        pre{\n            color: #abb2bf;\n            white-space: pre-wrap;\n            line-height: 1.6;\n            font-size: 14px;\n        }\n        .copy-btn{\n            display: block;\n            width: 120px;\n            height: 40px;\n            border: none;\n            background-color: #3498db;\n            color: #fff;\n            font-size: 15px;\n            border-radius: 6px;\n            cursor: pointer;\n            transition: all 0.3s;\n            margin: 0 auto;\n        }\n        .copy-btn:hover{\n            background-color: #2980b9;\n        }\n        .tip-text{\n            text-align: center;\n            margin-top: 15px;\n            color: #666;\n            height: 20px;\n        }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"box\">\n        <h2>\u6743\u91cd\u8ba1\u7b97MATLAB\u4ee3\u7801<\/h2>\n        <div class=\"code-wrap\">\n<pre id=\"codeText\">%\u7b97\u6570\u5e73\u5747\u6cd5\nA =input(\"\u5224\u65ad\u77e9\u9635A=\");\nSUMA =sum(A,1);\n[n,n] =size(A);\nAr=repmat(SUMA,n,1);\nStand_A=A.\/Ar;\nSUMAR =sum(Stand_A,2);\na=SUMAR\/n;\n\n%\u51e0\u4f55\u5e73\u5747\u6cd5\nPROD_A= prod(A,2);\nPROD_n_A=PROD_A.^(1\/n);\nb=PROD_n_A\/sum(PROD_n_A);\n\n%\u7279\u5f81\u503c\u8ba1\u7b97\u6743\u91cd\n[V,D]=eig(A);\nMAX=max(max(D));\n[r,c]=find(MAX == D,1);\nf=V(:,c).\/sum(V(:,c));\n\n%\u4e09\u8005\u5e73\u5747\u6743\u91cd\ndisp((a+b+f)\/3);<\/pre>\n        <\/div>\n        <button class=\"copy-btn\" onclick=\"copyCode()\">\u4e00\u952e\u590d\u5236\u4ee3\u7801<\/button>\n        <div class=\"tip-text\" id=\"tip\"><\/div>\n    <\/div>\n\n    <script>\n        function copyCode(){\n            const text = document.getElementById('codeText').innerText;\n            navigator.clipboard.writeText(text).then(()=>{\n                tip.innerText = '\u2705 \u590d\u5236\u6210\u529f';\n            }).catch(()=>{\n                let textarea = document.createElement('textarea');\n                textarea.value = text;\n                document.body.appendChild(textarea);\n                textarea.select();\n                document.execCommand('copy');\n                document.body.removeChild(textarea);\n                tip.innerText = '\u2705 \u590d\u5236\u6210\u529f';\n            })\n            setTimeout(()=>tip.innerText='',2000)\n        }\n    <\/script>\n<\/body>\n<\/html>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u81f4\u6027\u68c0\u9a8c\u4ee3\u7801\u5b9e\u73b0 \u5c42\u6b21\u5206\u6790\u6cd5 &#8211; \u4e00\u81f4\u6027\u68c0\u9a8c\u4ee3\u7801 \u5224\u65ad\u77e9\u9635\u4e00\u81f4\u6027\u68c0\u9a8cMATLAB\u4ee3\u7801 % \u5224\u65ad\u77e9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-256","post","type-post","status-publish","format-standard","hentry","category-17"],"_links":{"self":[{"href":"https:\/\/xifyun.online\/index.php\/wp-json\/wp\/v2\/posts\/256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xifyun.online\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xifyun.online\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xifyun.online\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xifyun.online\/index.php\/wp-json\/wp\/v2\/comments?post=256"}],"version-history":[{"count":7,"href":"https:\/\/xifyun.online\/index.php\/wp-json\/wp\/v2\/posts\/256\/revisions"}],"predecessor-version":[{"id":266,"href":"https:\/\/xifyun.online\/index.php\/wp-json\/wp\/v2\/posts\/256\/revisions\/266"}],"wp:attachment":[{"href":"https:\/\/xifyun.online\/index.php\/wp-json\/wp\/v2\/media?parent=256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xifyun.online\/index.php\/wp-json\/wp\/v2\/categories?post=256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xifyun.online\/index.php\/wp-json\/wp\/v2\/tags?post=256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}