>>name = {'AA'
'AAPL'
'ABT'
'AIG'
'AXP'
'BA'
'BAC'
'CVX'
'DO'
'DOW'
'IBM'
'GM'
'TGT'
'EBAY'
'GE'
'T'
'VZ'
'CAG'
'HD'
'KO'}
>> A=[ -0.0604
0.0257
-0.0565
0.0415
-0.1805
0.0528
0.2193
-0.0921
-0.0170
-0.0592
-0.0106
0.1614
0.0507
0.1692
0.5913
-0.2436
0.1038
-0.0091
-0.0195
-0.0482]
>> A=[A(1:5) A(6:10) A(11:15) A(16:20)]
A =
-0.0604 0.0528 -0.0106 -0.2436
0.0257 0.2193 0.1614 0.1038
-0.0565 -0.0921 0.0507 -0.0091
0.0415 -0.0170 0.1692 -0.0195
-0.1805 -0.0592 0.5913 -0.0482
>> name=[name(1:5) name(6:10) name(11:15) name(16:20)]
name =
'AA' 'BA' 'IBM' 'T'
'AAPL' 'BAC' 'GM' 'VZ'
'ABT' 'CVX' 'TGT' 'CAG'
'AIG' 'DO' 'EBAY' 'HD'
'AXP' 'DOW' 'GE' 'KO'
>> imagesc(A)
>> [rows,cols] = size(name);
for i = 1:rows
for j = 1:cols
textHandles(j,i) = text(j,i,name(i,j),...
'horizontalAlignment','center');
end
end
如何用Matlab绘制heat map
最新推荐文章于 2023-08-19 16:37:27 发布