当前位置:网站首页>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小知识,大家一起来学习进步阿!
边栏推荐
- 防“活化”照片蒙混过关,数据宝“活体检测+人脸识别”让刷脸更安全
- When using charts to display data, the time field in the database is repeated. How to display the value at this time?
- Contenttype comparison of all types
- Leetcode T34: 在排序数组中查找元素的第一个和最后一个位置
- golang中的正则表达式使用注意事项与技巧
- 使用beef劫持用户浏览器
- Php laraver Wechat payment
- Leetcode t31: prochain arrangement
- Leetcode t39: combined sum
- 【Redis】一气呵成,带你了解Redis安装与连接
猜你喜欢

Serial port oscilloscope software ns-scope
![[getting started] extract non repeating integers](/img/88/3e96df88e980bd98ac112b18a8678c.png)
[getting started] extract non repeating integers
![[staff] high and low octave mark (the notes in the high octave mark | mark range are increased by one octave as a whole | low octave mark | mark range are decreased by one octave as a whole)](/img/ff/ebd936eaa6e57b1eabb691b0642957.jpg)
[staff] high and low octave mark (the notes in the high octave mark | mark range are increased by one octave as a whole | low octave mark | mark range are decreased by one octave as a whole)

shardingSphere

SPL-安装与基本使用(二)

【入门】输入整型数组和排序标识,对其元素按照升序或降序进行排序

shardingSphere

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

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

Using settoolkit to forge sites to steal user information
随机推荐
Insufficient executors to build thread pool
Conception et mise en service du processeur - chapitre 4 tâches pratiques
5大组合拳,解决校园6大难题,护航教育信息化建设
Use threejs simple Web3D effect
Utiliser Beef pour détourner le navigateur utilisateur
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
机动目标跟踪——当前统计模型(CS模型)扩展卡尔曼滤波/无迹卡尔曼滤波 matlab实现
Luogu p1088 [noip2004 popularization group] Martians
Leetcode T39: 组合总和
使用beef劫持用戶瀏覽器
Hijacking a user's browser with beef
How can beginners correctly understand Google's official suggested architectural principles (questions?)
軟鍵盤高度報錯
Provincial election + noi Part VI skills and ideas
golang中的正则表达式使用注意事项与技巧
0 basic introduction to single chip microcomputer: how to use digital multimeter and precautions
php laravel微信支付
String coordinates of number to excel
Provincial election + noi Part III tree problems
Keithley 2100 software 𞓜 Keithley2400 test software ns SourceMeter