%fqbrainf.m rev tly 94,1,18; fcc class fq test results by statement check listing
%* For matlab 4.* figure window: <edit><copy option> set to <bit map>, ­Y³]¦¨<meta file>, §â¹Ï copy paste ¨ì word ¤¤¤§«á¡A¦C¦L¥X¨Ó®É ÂI½u : §é½u -- ³£ÅÜ¦¨¹ê½u ¦ÓµLªk°Ï¤À¡I
%calls function [fqr_percent, fqr_raw]=fqbrainr(fq_raw)
%% takes listing of checked statements in "fqBrainQ.doc Chinese Translation of the modified Lumsdaine brief form (ASCII version saved as fqBrainQ.txt), rev TLYeh 84,12,12"
%%  returns 3 cols of 4Q raw counts in fqr_raw and percentage in fqr_percent for Apparent, True, and Self Expectation, 
%% fq_raw has 3 cols of statement check marks for True, Apparent, and Self Expectation, as appeared on the questionair, respectively.
%%  also calls fqbraip to plot on current figure window 3 4Q squares for each person, then pause: 
%%   Apparent=solid, True=doted-circle, Expectation=dashed-cross
%% calls fqbrainp(fq_raw,point,line) to plot each 4Q square and get percent, with 
%%   line/tips style specified by character string 'line'/'point', 
%% do whitebg; before any figure is plotted, otherwise, close before whitebg again.
%%statement quadrant template:
%%q_=[A A B A B C B D  A A B B D  B B B B B D A C D C D D  A D D A D A D D D  D C D  A A C D C C A B C C C  A B C A B C B B A B C C C];
%% qa=[1 1 0 1 0 0 0 0  1 1 0 0 0  0 0 0 0 0 0 1 0 0 0 0 0  1 0 0 1 0 1 0 0 0  0 0 0  1 1 0 0 0 0 1 0 0 0 0  1 0 0 1 0 0 0 0 1 0 0 0 0]; % category A
%% qb=[0 0 1 0 1 0 1 0  0 0 1 1 0  1 1 1 1 1 0 0 0 0 0 0 0  0 0 0 0 0 0 0 0 0  0 0 0  0 0 0 0 0 0 0 1 0 0 0  0 1 0 0 1 0 1 1 0 1 0 0 0]; % category B
%% qc=[0 0 0 0 0 1 0 0  0 0 0 0 0  0 0 0 0 0 0 0 1 0 1 0 0  0 0 0 0 0 0 0 0 0  0 1 0  0 0 1 0 1 1 0 0 1 1 1  0 0 1 0 0 1 0 0 0 0 1 1 1]; % category C
%% qd=[0 0 0 0 0 0 0 1  0 0 0 0 1  0 0 0 0 0 1 0 0 1 0 1 1  0 1 1 0 1 0 1 1 1  1 0 1  0 0 0 1 0 0 0 0 0 0 0  0 0 0 0 0 0 0 0 0 0 0 0 0]; % category D
% "t"ly, "f"cc, ¤ý..r, j..¬Ã, ¤B..w, ´¿s.., h..±Ó, l..§g

%whitebg
% sample template of fq_tly for testing
fqt=[1 0 0 1 1 1 1 1  0 1 1 1 0  0 0 0 0 1 1 1 0 0 1 1 1  1 0 1 1 1 1 1 1 1  0 0 0  1 0 0 0 0 1 1 0 0 0 0  1 0 1 1 1 1 0 1 0 0 0 0 0; % true self
     1 1 0 1 1 1 0 1  1 1 1 1 1  1 1 1 1 1 0 1 1 1 1 1 0  1 1 1 1 1 1 1 1 1  1 1 1  1 0 0 0 0 0 1 0 0 0 0  1 1 1 1 1 1 1 1 1 0 1 1 1; % apparent
     1 1 0 1 1 1 0 1  1 1 1 1 1  1 1 1 0 0 0 0 0 1 0 1 0  1 1 1 1 1 1 0 1 0  1 1 1  1 1 1 0 0 0 0 0 0 0 0  1 0 1 1 1 1 1 1 1 1 1 1 1 ]; % expectation
figure(1), [fqt_pc, fqt_r]= fqbrainr(fqt), tpc100=round(100*fqt_pc);
 title(['fqt:','count[', ...
  int2str(fqt_r(:,1)),',', int2str(fqt_r(:,2)),',', int2str(fqt_r(:,3)), ...
    '],%[', ...
  int2str(tpc100(:,1)),',', int2str(tpc100(:,2)),',', int2str(tpc100(:,3)), ...
    ']'])

['fcc class 93F: "f"cc, ¤ý..r, j..¬Ã, ¤B..w, ´¿s.., h..±Ó, l..§g']

fqf=[0 1 0 1 0 1 0 1  0 0 0 0 0  1 0 0 1 0 0 1 0 0 0 1 0  0 0 0 0 0 0 0 0 1  0 0 0  0 0 1 0 0 1 0 1 1 0 0  1 1 1 0 0 1 0 0 0 0 0 1 0; % true self
     0 1 0 0 0 1 1 1  0 1 0 0 1  1 0 0 1 0 1 0 1 0 0 1 0  0 0 0 1 0 1 0 0 0  1 1 0  0 0 1 0 0 1 0 1 0 0 0  1 1 1 1 0 1 0 0 0 0 1 1 0; % apparent
     1 0 1 0 0 0 0 0  0 0 0 1 0  0 1 0 0 0 0 0 0 0 0 0 0  0 0 0 0 0 0 1 0 0  0 0 0  0 0 0 0 0 0 0 0 0 1 0  0 0 0 0 0 0 0 1 0 0 0 0 0 ]; % expectation
figure(2), [fqf_pc, fqf_r]= fqbrainr(fqf), tpc100=round(100*fqf_pc);
 title(['fqf:','count[', ...
  int2str(fqf_r(:,1)),',', int2str(fqf_r(:,2)),',', int2str(fqf_r(:,3)), ...
    '],%[', ...
  int2str(tpc100(:,1)),',', int2str(tpc100(:,2)),',', int2str(tpc100(:,3)), ...
    ']'])

fqr=[1 1 0 1 0 0 0 1  0 0 0 0 1  0 0 1 0 1 1 0 1 1 0 1 0  1 0 1 0 1 0 1 0 0  1 0 1  1 0 1 1 1 1 1 0 0 0 1  1 1 1 1 0 1 0 1 0 0 1 1 1; % true self
     1 1 0 1 0 0 0 1  0 0 0 0 1  0 0 1 0 0 1 0 1 1 0 1 0  0 0 1 0 1 0 0 0 0  1 0 1  1 0 1 1 1 1 1 0 1 0 1  1 1 1 1 0 1 0 1 0 0 1 1 1; % apparent
     0 0 0 0 0 1 0 0  0 0 0 0 0  0 0 0 0 0 0 0 0 0 0 0 1  0 0 0 0 0 1 0 0 0  0 1 0  0 1 0 0 0 0 0 1 0 0 0  0 0 0 0 0 0 0 0 0 0 0 0 0 ]; % expectation
figure(3), [fqr_pc, fqr_r]= fqbrainr(fqr), tpc100=round(100*fqr_pc);
 title(['fqr:','count[', ...
  int2str(fqr_r(:,1)),',', int2str(fqr_r(:,2)),',', int2str(fqr_r(:,3)), ...
    '],%[', ...
  int2str(tpc100(:,1)),',', int2str(tpc100(:,2)),',', int2str(tpc100(:,3)), ...
    ']'])

fqj=[0 1 1 1 0 1 0 1  0 0 0 1 1  0 0 0 0 1 1 1 1 0 0 0 0  1 0 1 0 1 1 1 1 1  1 1 1  0 0 1 1 0 0 0 1 1 1 1  1 1 1 1 0 1 0 0 0 1 1 1 1; % true self
     0 1 1 1 0 0 0 1  0 0 0 1 1  0 0 0 0 1 1 1 1 0 0 0 0  1 0 1 0 1 0 1 1 1  0 1 1  0 0 1 1 0 0 0 1 1 1 1  1 1 1 1 0 1 0 1 0 1 1 1 1; % apparent
     0 0 0 0 0 1 0 0  0 1 1 0 0  1 0 0 0 0 0 0 0 1 0 0 1  0 1 0 1 0 1 0 0 0  1 0 0  0 0 0 0 0 0 1 0 0 0 0  0 0 0 0 0 0 1 1 1 0 0 0 0 ]; % expectation
figure(4), [fqj_pc, fqj_r]= fqbrainr(fqj), tpc100=round(100*fqj_pc);
 title(['fqj:','count[', ...
  int2str(fqj_r(:,1)),',', int2str(fqj_r(:,2)),',', int2str(fqj_r(:,3)), ...
    '],%[', ...
  int2str(tpc100(:,1)),',', int2str(tpc100(:,2)),',', int2str(tpc100(:,3)), ...
    ']'])

fqw=[1 1 1 1 1 1 0 0  0 0 0 0 1  0 1 1 0 0 0 0 1 0 1 1 1  1 0 0 0 1 0 0 1 1  1 1 0  0 0 1 1 0 1 0 1 1 0 0  1 0 1 1 1 1 0 1 1 1 0 1 0; % true self
     1 1 1 1 1 0 0 0  0 0 0 0 1  0 1 1 0 0 0 0 1 0 1 1 1  1 0 1 0 1 1 0 1 0  0 1 0  0 0 1 1 0 1 0 1 1 0 1  1 0 1 1 1 1 0 0 1 0 0 1 0; % apparent
     0 0 0 0 1 0 0 1  0 1 0 0 0  1 0 0 1 0 1 0 0 0 0 0 0  0 0 0 0 0 0 0 0 0  0 0 0  0 0 0 0 0 0 0 0 0 0 0  0 0 0 0 0 0 0 0 0 0 0 0 0 ]; % expectation
figure(5), [fqw_pc, fqw_r]= fqbrainr(fqw), tpc100=round(100*fqw_pc);
 title(['fqw:','count[', ...
  int2str(fqw_r(:,1)),',', int2str(fqw_r(:,2)),',', int2str(fqw_r(:,3)), ...
    '],%[', ...
  int2str(tpc100(:,1)),',', int2str(tpc100(:,2)),',', int2str(tpc100(:,3)), ...
    ']'])

fqs=[0 1 0 1 0 0 0 0  0 0 0 0 0  1 1 1 0 0 0 0 1 0 0 0 0  0 1 0 0 0 0 0 1 1  0 1 1  0 0 1 0 1 0 0 0 1 1 1  1 0 0 1 1 1 1 0 1 0 1 0 0; % true self
     0 1 0 1 0 1 0 1  1 1 0 0 0  1 1 0 0 0 0 0 1 0 0 0 0  0 1 0 0 0 0 0 1 1  0 1 1  0 0 1 1 1 0 0 0 1 1 1  1 0 0 1 0 1 1 0 1 0 0 0 0; % apparent
     1 0 0 0 0 1 0 1  1 1 1 1 1  0 0 0 0 0 1 0 0 0 0 1 0  0 0 1 1 0 1 0 0 0  1 0 0  0 0 0 0 0 0 1 1 0 0 0  0 0 0 0 0 0 0 0 0 0 0 0 0 ]; % expectation
figure(6), [fqs_pc, fqs_r]= fqbrainr(fqs), tpc100=round(100*fqs_pc);
 title(['fqs:','count[', ...
  int2str(fqs_r(:,1)),',', int2str(fqs_r(:,2)),',', int2str(fqs_r(:,3)), ...
    '],%[', ...
  int2str(tpc100(:,1)),',', int2str(tpc100(:,2)),',', int2str(tpc100(:,3)), ...
    ']'])

fqh=[0 0 1 0 0 1 0 1  0 0 0 1 1  0 0 0 0 0 0 0 1 0 0 1 0  0 0 1 0 1 0 0 1 1  1 1 1  0 0 1 0 0 0 0 1 1 1 1  0 1 1 0 0 1 0 1 0 0 1 1 0; % true self
     0 1 0 1 0 1 0 1  0 0 0 1 1  0 0 0 0 0 1 0 1 1 0 1 0  0 1 1 0 1 0 1 1 0  1 1 1  0 0 1 1 1 0 0 1 1 1 1  0 1 1 0 0 1 1 1 1 0 1 1 0; % apparent
     1 1 0 0 0 0 0 0  0 1 1 0 0  1 0 0 1 0 1 0 0 0 1 0 1  0 1 0 0 0 1 0 0 0  0 0 0  1 1 0 0 0 0 1 0 0 0 0  0 0 0 0 1 0 0 0 0 0 0 0 0 ]; % expectation
figure(7), [fqh_pc, fqh_r]= fqbrainr(fqh), tpc100=round(100*fqh_pc);
 title(['fqh:','count[', ...
  int2str(fqh_r(:,1)),',', int2str(fqh_r(:,2)),',', int2str(fqh_r(:,3)), ...
    '],%[', ...
  int2str(tpc100(:,1)),',', int2str(tpc100(:,2)),',', int2str(tpc100(:,3)), ...
    ']'])

fql=[0 1 0 0 0 1 0 0  0 0 0 1 0  0 1 0 0 0 0 0 1 0 1 0 1  0 0 0 0 0 0 1 1 1  0 0 1  0 0 1 1 0 1 0 0 1 1 0  1 0 1 1 1 1 0 0 0 0 1 0 1; % true self
     0 1 0 1 0 1 0 0  0 0 0 1 0  0 1 0 0 0 0 0 1 0 1 0 1  0 0 1 0 0 0 1 1 1  0 0 1  0 0 1 1 0 1 0 0 1 0 0  1 0 1 1 1 1 0 1 0 0 1 0 1; % apparent
     1 0 1 0 1 0 1 1  1 0 1 0 1  1 0 1 1 0 1 0 0 1 0 1 0  0 1 0 1 1 1 0 0 0  1 1 0  0 0 0 0 0 0 0 1 0 0 0  0 0 0 0 0 0 0 1 1 1 0 1 0 ]; % expectation
figure(8), [fql_pc, fql_r]= fqbrainr(fql), tpc100=round(100*fql_pc);
 title(['fql:','count[', ...
  int2str(fql_r(:,1)),',', int2str(fql_r(:,2)),',', int2str(fql_r(:,3)), ...
    '],%[', ...
  int2str(tpc100(:,1)),',', int2str(tpc100(:,2)),',', int2str(tpc100(:,3)), ...
    ']'])

% The fcc group average including the teacher: 

% avg by %
fccg_pc=zeros([4,3]);
for k=[1:3], 
 fccg_pc(:,k)= ...
 mean([fqf_pc(:,k),fqr_pc(:,k),fqw_pc(:,k),fqj_pc(:,k),fqs_pc(:,k),fql_pc(:,k),fqh_pc(:,k)]')';
end
figure(9), 
fccg_pc100=zeros([4,3]);
hold off
 fccg_pc100(:,1)=round(100*fqbrainp(fccg_pc(:,1),'k','k')); % apparent
hold on
 fccg_pc100(:,2)=round(100*fqbrainp(fccg_pc(:,2),'ok',':k')); % true-hidden
hold on
 fccg_pc100(:,3)=round(100*fqbrainp(fccg_pc(:,3),'+k','--k')); % expectation
 xlabel('___apparent ...true.hidden ---self-expect')
title(['fcc_group w/teacher avg by %:', ...
    '%[', ...
  int2str(fccg_pc100(:,1)),',', int2str(fccg_pc100(:,2)),',', int2str(fccg_pc100(:,3)), ...
    ']'])
hold off
fccg_pc, fccg_pc100,

% avg by count
fccg=zeros([4,3]);
for k=[1:3], 
 fccg(:,k)= ...
 round(mean([fqf_r(:,k),fqr_r(:,k),fqw_r(:,k),fqj_r(:,k),fqs_r(:,k),fql_r(:,k),fqh_r(:,k)]')');
end
figure(10), 
fccgpc100=zeros([4,3]);
hold off
 fccgpc100(:,1)=round(100*fqbrainp(fccg(:,1),'k','k')); % apparent
hold on
 fccgpc100(:,2)=round(100*fqbrainp(fccg(:,2),'ok',':k')); % true-hidden
hold on
 fccgpc100(:,3)=round(100*fqbrainp(fccg(:,3),'+k','--k')); % expectation
 xlabel('___apparent ...true.hidden ---self-expect')
title(['fcc_group w/teacher avg by count:', ...
    '%[', ...
  int2str(fccgpc100(:,1)),',', int2str(fccgpc100(:,2)),',', int2str(fccgpc100(:,3)), ...
    ']'])
hold off
fccg, fccgpc100,

