% break in FCM_dV/line 376
%save gs_P gs_w
% the_gs_P=gs_points(:,:)';% I*nw x 3
% the_gs_norm=sub_norm;% [] x 3
% the_gs_w=gs_w(:);% I*nw x 1

the_gs_P=gs_points(:,:)';% I*nw x 3
the_gs_norm=repmat(the_norm,nw,1);
the_gs_w=gs_w(:);% I*nw x 1

save TMP_Bracket_Pwn.mat the_gs_P the_gs_w the_gs_norm

%

load TMP_Bracket_Pwn.mat
jdnz=the_gs_w~=0;
the_gs_w=the_gs_w(jdnz,:);
the_gs_P=the_gs_P(jdnz,:);
the_gs_norm=the_gs_norm(jdnz,:);

%
%% write DBC

fid = fopen('NNew_Data/DBC.txt', 'wt');
mat = the_gs_P;
for i = 1:size(mat, 1)
    fprintf(fid, '%f\t', mat(i,:));
    fprintf(fid, '\n');
end

mat = the_gs_norm;
for i = 1:size(mat, 1)
    fprintf(fid, '%f\t', mat(i,:));
    fprintf(fid, '\n');
end

mat = the_gs_w;
for i = 1:size(mat, 1)
    fprintf(fid, '%f\t', mat(i,:));
    fprintf(fid, '\n');
end

fclose(fid);