-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCPdispSIRs.m
executable file
·39 lines (38 loc) · 1.12 KB
/
CPdispSIRs.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
function CPdispSIRs(sirs)
%%function CPdispSIRs(sirs)
% sirs is a matrix
% column j denotes the averaged sirs of each component in mode-j
global NumOfMode NumOfComp tdalabStatus;
fprintf('## SIRs of each Comp.:\n');
LNOC=max(NumOfComp);
hstr=' ';
for n=1:NumOfMode
hstr=[hstr,' Mode ',num2str(n)];
end
hstr=[hstr,'\n'];
fprintf(hstr);
k1str=horzcat('Comp. %d ',repmat('%10.4f',1,LNOC));
k10str=horzcat('Comp. %d ',repmat('%10.4f',1,LNOC));
for k=1:max(NumOfComp)
if k<10
fprintf(k1str,k,sirs(k,:));
fprintf('\n');
else
fprintf(k10str,k,sirs(k,:));
fprintf('\n');
end
end
if strcmp(tdalabStatus.model,'CP')
ms=mean(sirs);
else
for n=1:NumOfMode
msn=sirs(:,n);msn(isnan(msn))=[];
ms(n)=mean(msn);
end
end
fprintf(['Avg. ',repmat('%10.4f',1,LNOC),'\n'],ms);
if strcmp(tdalabStatus.model,'Tucker')
fprintf('\n*''NaN'': means that this component does not exist.\n');
end
fprintf('\n');
end