当前位置:网站首页>MATLAB小技巧(16)矩阵特征向量特征值求解一致性验证--层次分析
MATLAB小技巧(16)矩阵特征向量特征值求解一致性验证--层次分析
2022-07-01 08:15:00 【mozun2020】
MATLAB小技巧(16)矩阵特征向量特征值求解一致性验证--层次分析
前言
MATLAB进行图像处理相关的学习是非常友好的,可以从零开始,对基础的图像处理都已经有了封装好的许多可直接调用的函数,这个系列文章的话主要就是介绍一些大家在MATLAB中常用一些概念函数进行例程演示!
对矩阵的特征值与特征向量进行求解,根据最大特征值与对应特征向量,得到准则层特征向量与准则层最大特征根,再进行一致性检验参数计算,满足阈值则为满足一致性验证,不满足阈值则需进行重新评分。
搜寻资料的时候遇到的这个示例,这里分享给大家,MATLAB版本为MATLAB2015b。
一. MATLAB仿真
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%功能:矩阵特征向量特征值求解一致性验证--层次分析示例
%环境:Win7,Matlab2015b
%Modi: C.S
%时间:2022-06-24
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 清空环境变量
clear all
clc
tic
A=[1 1/5 1 1/5 1/6 1/6
5 1 5 1/2 1/2 1/2
2 1/5 1 1/4 1/6 1/4
5 1/2 4 1 1/2 1/2
6 2 6 2 1 1
6 2 4 2 1 1]
[n,n]=size(A);
[V,D]=eig(A);%求得特征向量和特征值
%求出最大特征值和它所对应的特征向量
tempNum=D(1,1);
pos=1;
for h=1:n
if D(h,h)>tempNum
tempNum=D(h,h);
pos=h;
end
end
w=abs(V(:,pos));
w=w/sum(w);
t=D(pos,pos);
disp('准则层特征向量w=');disp(w);disp('准则层最大特征根t=');disp(t);
%以下是一致性检验
CI=(t-n)/(n-1);RI=[0 0 0.58 0.89 1.12 1.26 1.36 1.41 1.46 1.49 1.52 1.54 1.56 1.58 1.59 1.60 1.61 1.615 1.62 1.63];
CR=CI/RI(n);
if CR<0.10
disp('此矩阵的一致性可以接受!');
disp('CI=');disp(CI);
disp('CR=');disp(CR);
else
disp('此矩阵的一致性验证失败,请重新进行评分!');
end
toc
二. 仿真结果
A =
1.0000 0.2000 1.0000 0.2000 0.1667 0.1667
5.0000 1.0000 5.0000 0.5000 0.5000 0.5000
2.0000 0.2000 1.0000 0.2500 0.1667 0.2500
5.0000 0.5000 4.0000 1.0000 0.5000 0.5000
6.0000 2.0000 6.0000 2.0000 1.0000 1.0000
6.0000 2.0000 4.0000 2.0000 1.0000 1.0000
准则层特征向量w=
0.0425
0.1677
0.0546
0.1580
0.2976
0.2797
准则层最大特征根t=
6.0846
此矩阵的一致性可以接受!
CI=
0.0169
CR=
0.0134
时间已过 0.007250 秒。

三. 小结
一致性验证的示例,后期可能会用到,这里做个笔记。每天学一个MATLAB小知识,大家一起来学习进步阿!
边栏推荐
- C basic knowledge review (Part 4 of 4)
- [force deduction 10 days SQL introduction] Day10 control flow
- Tupu software has passed CMMI5 certification| High authority and high-level certification in the international software field
- Suivi des cibles de manoeuvre - - mise en oeuvre du modèle statistique actuel (modèle CS) filtre Kalman étendu / filtre Kalman sans trace par MATLAB
- Data analysis notes 11
- Utiliser Beef pour détourner le navigateur utilisateur
- 2022 mechanical fitter (primary) examination summary and mechanical fitter (primary) reexamination examination
- [getting started] input n integers and output the smallest K of them
- [redis] it takes you through redis installation and connection at one go
- To prevent "activation" photos from being muddled through, databao "live detection + face recognition" makes face brushing safer
猜你喜欢

軟鍵盤高度報錯

Gateway-88

【入门】提取不重复的整数

Instead of houses, another kind of capital in China is rising

使用beef劫持用户浏览器

【入门】截取字符串

Learn the knowledge you need to know about the communication protocol I2C bus

Conception et mise en service du processeur - chapitre 4 tâches pratiques
![[getting started] input n integers and output the smallest K of them](/img/b8/20852484f10bc968d529e9c1ff5480.png)
[getting started] input n integers and output the smallest K of them

Using settoolkit to forge sites to steal user information
随机推荐
web254
SPL-介绍(一)
Codeforces Round #803 (Div. 2) VP补题
[getting started] extract non repeating integers
软键盘高度报错
php laravel微信支付
PostgreSQL source code learning (26) -- windows vscode remote debugging PostgreSQL on Linux
Stack implementation calculator
EDA开源仿真工具verilator入门6:调试实例
Find the nearest n-th power of 2
empirical study and case study
Provincial election + noi part I dynamic planning DP
The difference between interceptors and filters
2022 Chinese cook (technician) simulation test and Chinese cook (technician) practice test video
【入门】提取不重复的整数
Manually dig XSS vulnerabilities
Deep learning systematic learning
Soft keyboard height error
Koltin35, headline Android interview algorithm
[detailed explanation of Huawei machine test] judgment string subsequence [2022 Q1 Q2 | 200 points]