-
Notifications
You must be signed in to change notification settings - Fork 0
/
Qbforbreaking.m
31 lines (25 loc) · 2.36 KB
/
Qbforbreaking.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
function Qbrk=Qbforbreaking(val)
% val(val<0.01 | isnan(val))=0.01;val(val>=1)=1;
% % Q=fzero(@(x) ((1-x)/log(x))+val,val)
% % (1-Q)/log(Q)+val
%
%
% dx=0.01;
% % x=[0.0001:dx:1];y=-(1-x)./log(x);
% % for j=1:1/dx;
% % v=j*0.01;
% % [i,a]=(min(abs(y-v)));
% % QBR(j)=x(a);
% % end
% QBR=[0,0,0,0.000100000000000000,0.000100000000000000,0.000100000000000000,0.000100000000000000,0.000100000000000000,0.000100000000000000,0.000100000000000000,0.000100000000000000,0.000100000000000000,0.000100000000000000,0.000100000000000000,0.000100000000000000,0.000100000000000000,0.000100000000000000,0.0101000000000000,0.0101000000000000,0.0101000000000000,0.0101000000000000,0.0101000000000000,0.0101000000000000,0.0101000000000000,0.0201000000000000,0.0201000000000000,0.0201000000000000,0.0301000000000000,0.0301000000000000,0.0301000000000000,0.0401000000000000,0.0501000000000000,0.0501000000000000,0.0601000000000000,0.0601000000000000,0.0701000000000000,0.0801000000000000,0.0801000000000000,0.0901000000000000,0.100100000000000,0.110100000000000,0.120100000000000,0.120100000000000,0.130100000000000,0.140100000000000,0.150100000000000,0.160100000000000,0.170100000000000,0.180100000000000,0.190100000000000,0.200100000000000,0.210100000000000,0.230100000000000,0.240100000000000,0.250100000000000,0.260100000000000,0.270100000000000,0.290100000000000,0.300100000000000,0.300100000000000,0.320100000000000,0.340100000000000,0.350100000000000,0.360100000000000,0.380100000000000,0.380100000000000,0.390100000000000,0.410100000000000,0.420100000000000,0.450100000000000,0.470100000000000,0.480100000000000,0.500100000000000,0.510100000000000,0.530100000000000,0.550100000000000,0.560100000000000,0.580100000000000,0.590100000000000,0.610100000000000,0.630100000000000,0.650100000000000,0.660100000000000,0.680100000000000,0.700100000000000,0.720100000000000,0.730100000000000,0.750100000000000,0.770100000000000,0.790100000000000,0.810100000000000,0.830100000000000,0.840100000000000,0.840100000000000,0.860100000000000,0.900100000000000,0.920100000000000,0.940100000000000,0.960100000000000,0.980100000000000,0.990100000000000];
%
% pos=floor(val/dx);
% Qbrk=QBR(pos);
%val(val<0.1)=0;
%val(val>1)=1;
% Qbrk=0*val;
% Qbrk(val>0.1 & val<1)=((val(val>0.1 & val<1)-0.1)/0.9).^2;
% Qbrk(val>=1)=1;
Qbrk=0*val;
Qbrk(val>0. & val<1)=((val(val>0. & val<1))).^2;
Qbrk(val>=1)=1;