-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo_var.m
41 lines (34 loc) · 1.21 KB
/
demo_var.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
clear; close all;
method = 'CSNet';
subrate = 0.2;
data = load(['mtxResults\meas_' method '_r' num2str(subrate) '_rate' num2str(subrate) '.mat']);
for i = 1:1:size(data.Phi, 3)
tmp = data.Phi(:, :, i);
tmp_var(i) = var(tmp(:));
end
pr = figure(1);
plot(sort(tmp_var(:)), 'k', 'LineWidth', 2);
grid on; hold on;
method = 'MS-CSNet3';
data = load(['mtxResults\meas_' method '_r' num2str(subrate) '_rate' num2str(subrate) '.mat']);
% first section
for i = 1:1:size(data.Phi, 4)
tmp = data.Phi(:, :, 1, i);
tmp_var1(i) = var(tmp(:));
tmp = data.Phi(:, :, 2, i);
tmp_var2(i) = var(tmp(:));
tmp = data.Phi(:, :, 3, i);
tmp_var3(i) = var(tmp(:));
tmp = data.Phi(:, :, 4, i);
tmp_var4(i) = var(tmp(:));
end
% figure(2);
plot(sort(tmp_var1(:)), 'r', 'LineWidth', 2); %hold on;
plot(sort(tmp_var2(:)), 'b', 'LineWidth', 2);
plot(sort(tmp_var3(:)), 'm', 'LineWidth', 2);
plot(sort(tmp_var4(:)), 'g', 'LineWidth', 2);
grid on;
legend('CSNet', 'W-DCS-LL', 'W-DCS-LH', 'W-DCS-HL', 'W-DCS-HH'); set(gca,'fontsize', 14);
hold off; axis tight
saveas(pr, ['rate' num2str(subrate) '.png']);
saveas(pr, ['rate' num2str(subrate) '.fig']);