forked from yuehniu/Remote.Sensing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestNfindr.m
More file actions
27 lines (24 loc) · 724 Bytes
/
testNfindr.m
File metadata and controls
27 lines (24 loc) · 724 Bytes
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
%% compare between MDC and MVC algorithm
clear all
% generate true W, H, V
sampleNum = 900;
noiseLevel = 0.2;
bandNum = 4;
endNum = 4;
% compare several times
HTrue = abs( randn( endNum, bandNum ) );
V = create4(sampleNum, HTrue);
% run Nfindr
indxNfindr = nFindr(V, endNum);
HNfindr = V(indxNfindr, :);
% visualize result
figure;
hold on
scatter3(V(:,1), V(:,2), V(:, 3), 'x');
scatter3(HTrue(:, 1), HTrue(:, 2), HTrue(:, 3), 'filled', 'r');
%scatter3(HNfindr(:, 1), HNfindr(:, 2), HNfindr(:, 3), 'filled', 'k')
xlabel('波段1')
ylabel('波段2')
zlabel('波段3')
legend('高光谱数据', '真实端元', '求取的端元')
grid on