1樓:匿名使用者
[v,d]=eig(a)
d為特徵值
v的列向量為對應特徵值的特徵向量
2樓:化學工程
20個太多,用2個舉例:
clc;clear
m=1;n=2;
for x=1:n
for y=1:n
for z=1:n
a(:,:,m)=[0 -1 x 0;1 0 0 x;y 0 z/y -1;0 y 1 z/x];
[v(:,:,m),d(:,:,m)]=eig(a(:,:,m))
m=m+1;
endend
end結果:
v(:,:,1) =
0.0000 + 0.6015i 0.0000 - 0.6015i 0.3717 + 0.0000i 0.3717 - 0.0000i
0.6015 0.6015 -0.0000 - 0.3717i -0.0000 + 0.3717i
-0.0000 - 0.3717i -0.0000 + 0.3717i 0.6015 0.6015
-0.3717 + 0.0000i -0.3717 - 0.0000i -0.0000 - 0.6015i -0.0000 + 0.6015i
v(:,:,2) =
-0.6533 -0.6533 0.2706 + 0.0000i 0.2706 - 0.0000i
0.0000 + 0.6533i 0.0000 - 0.6533i -0.0000 - 0.2706i -0.0000 + 0.2706i
0.2706 + 0.0000i 0.2706 - 0.0000i 0.6533 0.6533
-0.0000 - 0.2706i -0.0000 + 0.2706i -0.0000 - 0.6533i -0.0000 + 0.6533i
v(:,:,3) =
0.0527 - 0.3450i 0.0527 + 0.3450i -0.4661 + 0.0198i -0.4661 - 0.0198i
-0.3238 - 0.0141i -0.3238 + 0.0141i 0.0517 + 0.4846i 0.0517 - 0.4846i
0.1132 - 0.5975i 0.1132 + 0.5975i 0.5407 0.5407
-0.6351 -0.6351 -0.0717 - 0.4974i -0.0717 + 0.4974i
v(:,:,4) =
0.1041 - 0.2772i 0.1041 + 0.2772i -0.0501 + 0.5145i -0.0501 - 0.5145i
-0.2482 - 0.0204i -0.2482 + 0.0204i 0.5498 0.5498
0.2535 - 0.5790i 0.2535 + 0.5790i 0.0867 - 0.4927i 0.0867 + 0.4927i
-0.6714 -0.6714 -0.4237 + 0.0265i -0.4237 - 0.0265i
v(:,:,5) =
0.6337 0.6337 -0.0539 - 0.4971i -0.0539 + 0.4971i
0.0386 - 0.6054i 0.0386 + 0.6054i -0.5384 -0.5384
-0.3265 + 0.0121i -0.3265 - 0.0121i -0.0740 - 0.4843i -0.0740 + 0.4843i
-0.0373 + 0.3496i -0.0373 - 0.3496i -0.4688 - 0.0167i -0.4688 + 0.0167i
v(:,:,6) =
0.6681 0.6681 0.4123 + 0.0339i 0.4123 - 0.0339i
0.0609 - 0.6253i 0.0609 + 0.6253i 0.1729 - 0.4606i 0.1729 + 0.4606i
-0.2574 + 0.0161i -0.2574 - 0.0161i 0.5578 0.5578
-0.0527 + 0.2994i -0.0527 - 0.2994i 0.2106 - 0.4810i 0.2106 + 0.4810i
v(:,:,7) =
0.5301 0.5301 -0.4680 - 0.0000i -0.4680 + 0.0000i
0.0000 - 0.5301i 0.0000 + 0.5301i -0.0000 + 0.4680i -0.0000 - 0.4680i
-0.4680 + 0.0000i -0.4680 - 0.0000i -0.5301 -0.5301
-0.0000 + 0.4680i -0.0000 - 0.4680i -0.0000 + 0.5301i -0.0000 - 0.5301i
v(:,:,8) =
-0.5573 -0.5573 -0.0000 + 0.4352i -0.0000 - 0.4352i
0.0000 + 0.5573i 0.0000 - 0.5573i 0.4352 + 0.0000i 0.4352 - 0.0000i
0.4352 + 0.0000i 0.4352 - 0.0000i -0.0000 + 0.5573i -0.0000 - 0.5573i
-0.0000 - 0.4352i -0.0000 + 0.4352i 0.5573 0.5573
d(:,:,1) =
-0.6180 + 1.0000i 0 0 0
0 -0.6180 - 1.0000i 0 0
0 0 1.6180 + 1.0000i 0
0 0 0 1.6180 - 1.0000i
d(:,:,2) =
-0.4142 + 1.0000i 0 0 0
0 -0.4142 - 1.0000i 0 0
0 0 2.4142 + 1.0000i 0
0 0 0 2.4142 - 1.0000i
d(:,:,3) =
1.8415 + 0.9852i 0 0 0
0 1.8415 - 0.9852i 0 0
0 0 -1.0915 + 0.9933i 0
0 0 0 -1.0915 - 0.9933i
d(:,:,4) =
2.3617 + 0.9230i 0 0 0
0 2.3617 - 0.9230i 0 0
0 0 -0.8617 + 0.9840i 0
0 0 0 -0.8617 - 0.9840i
d(:,:,5) =
-1.0915 + 0.9933i 0 0 0
0 -1.0915 - 0.9933i 0 0
0 0 1.8415 + 0.9852i 0
0 0 0 1.8415 - 0.9852i
d(:,:,6) =
-0.8617 + 0.9840i 0 0 0
0 -0.8617 - 0.9840i 0 0
0 0 2.3617 + 0.9230i 0
0 0 0 2.3617 - 0.9230i
d(:,:,7) =
-1.7656 + 1.0000i 0 0 0
0 -1.7656 - 1.0000i 0 0
0 0 2.2656 + 1.0000i 0
0 0 0 2.2656 - 1.0000i
d(:,:,8) =
-1.5616 + 1.0000i 0 0 0
0 -1.5616 - 1.0000i 0 0
0 0 2.5616 + 1.0000i 0
0 0 0 2.5616 - 1.0000i
如何用matlab將矩陣中的數字變顏色
matlab讀取之後是復乙個rgb三原色組成的三維矩 制陣,現在需要將圖中黑 綠 黃 紅 圖上有兩種紅色需要視作一種 四種顏色的畫素點分別以0,0.01,1和2來表示,希望得到畫素點的二維矩陣,維數等於解析度,求具體實現的 望採納 matlab實現矩陣裡數值的大小對應顏色的深淺 資料如果存在矩陣a裡...
matlab新手求教如何用matlab求導及求導後代入數值
用diff 來求導函式,用eval 來計算導數值。具體 如下 執行結果為 matlab中,乙個函式有多個自變數,怎麼分別求導並代入具體數值,舉個例子f x1 x2 x3,分 求導用diff expr,var,order 代入數值用subs expr,var,val 你好!我依照你來舉得例子自,簡單編...
用matlab如何求矩陣和數相乘
a 1,2,3 4,5,6 b a 2 c 1,2 1,2 1,2 d a c b b 2 4 6 8 10 12 d d 6 12 15 30 直接乘就可以,比如3 x 怎樣用matlab求矩陣的乘積 用matlab求矩陣 復的乘積 一般乘法 制a b a baib代表兩個du矩陣。b 2,5,8...