Matlab数据可视化

Posted Gendan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Matlab数据可视化相关的知识,希望对你有一定的参考价值。

%% 导入数据
load tran_data.mat
class=avilatr(:,end); %这个方法读取出来是table
class1=avilatr{:,end}; %这个读取出来是字符串,可以用find操作
%% A类索引
class_A=find(class1=="A")\';
A=avilatr{class_A,1:10};
%% 每一列属性
A1=A(:,1);A2=A(:,2);A3=A(:,3);A4=A(:,4);A5=A(:,5);A6=A(:,6);A7=A(:,7);A8=A(:,8);A9=A(:,9);A10=A(:,10);
%% B类索引
class_B=find(class1=="B")\';
B=avilatr{class_B,1:10};
%% 每一列属性
B1=B(:,1);PerfectMoney下载B2=B(:,2);B3=B(:,3);B4=B(:,4);B5=B(:,5);B6=B(:,6);B7=B(:,7);B8=B(:,8);B9=B(:,9);B10=B(:,10);
%% C类索引
class_C=find(class1=="C")\';
C=avilatr{class_C,1:10};
%% 每一列属性
C1=C(:,1);C2=C(:,2);C3=C(:,3);C4=C(:,4);C5=C(:,5);C6=C(:,6);C7=C(:,7);C8=C(:,8);C9=C(:,9);C10=C(:,10);
%% histogram 1
figure(1)
suptitle(\'Histogram 1\')
subplot(3,3,1);
histogram(A1,20);title(\'Attribute1 of A\')
subplot(3,3,2);
histogram(A2,20);title(\'Attribute2 of A\');
subplot(3,3,3);
histogram(A3,20);title(\'Attribute3 of A\')
subplot(3,3,4);
histogram(B1,20);title(\'Attribute1 of B\')
subplot(3,3,5);
histogram(B2,20);title(\'Attribute2 of B\')
subplot(3,3,6);
histogram(B3,20);title(\'Attribute3 of B\')
subplot(3,3,7);
histogram(C1,20);title(\'Attribute1 of C\')
subplot(3,3,8);
histogram(C2,20);title(\'Attribute2 of C\')
subplot(3,3,9);
histogram(C3,20);title(\'Attribute3 of C\')
%% Histogram 2
figure(2)
suptitle(\'Histogram 2\')
subplot(3,3,1)
histogram(A4,20);title(\'Attribute4 of A\')
subplot(3,3,2)
histogram(A5,20);title(\'Attribute5 of A\')
subplot(3,3,3)
histogram(A6,20);title(\'Attribute6 of A\')
subplot(3,3,4)
histogram(B4,20);title(\'Attribute4 of B\')
subplot(3,3,5)
histogram(B5,20);title(\'Attribute5 of B\')
subplot(3,3,6)
histogram(B6,20);title(\'Attribute6 of B\')
subplot(3,3,7)
histogram(C4,20);title(\'Attribute4 of C\')
subplot(3,3,8)
histogram(C5,20);title(\'Attribute5 of C\')
subplot(3,3,9)
histogram(C6,20);title(\'Attribute6 of C\')
%% Histogram 3
figure(3)
suptitle(\'Histogram 3\')
subplot(3,4,1)
histogram(A7,20);title(\'Attribute7 of A\')
subplot(3,4,2)
histogram(A8,20);title(\'Attribute8 of A\')
subplot(3,4,3)
histogram(A9,20);title(\'Attribute9 of A\')
subplot(3,4,4)
histogram(A10,20);title(\'Attribute10 of A\')
subplot(3,4,5)
histogram(B7,20);title(\'Attribute7 of B\')
subplot(3,4,6)
histogram(B8,20);title(\'Attribute8 of B\')
subplot(3,4,7)
histogram(B9,20);title(\'Attribute9 of B\')
subplot(3,4,8)
histogram(B10,20);title(\'Attribute10 of B\')
subplot(3,4,9)
histogram(C7,20);title(\'Attribute7 of C\')
subplot(3,4,10)
histogram(C8,20);title(\'Attribute8 of C\')
subplot(3,4,11)
histogram(C9,20);title(\'Attribute9 of C\')
subplot(3,4,12)
histogram(C10,20);title(\'Attribute10 of C\')

以上是关于Matlab数据可视化的主要内容,如果未能解决你的问题,请参考以下文章

Matlab数据可视化

Matlab画图实现数据可视化

Matlab数据可视化

用Matlab对导出的数据进行可视化

在matlab中可视化地将数据分成两类

MATLAB学习笔记——数据可视化