⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dim_fract.m

📁 calculates the fractal dimension of a set in the 2D plane using the box counting method.
💻 M
字号:
function  Dim_Fract(a,b)%   initialisation des variablesT_x=a;T_y=b;x=a;y=b;Kmax=100;Lm_T=0;%****************************************************N=length(y);for k=1:Kmax    L(k)=(N-1)/k*sum(sqrt((y(1:end-k)-y(1+k:end)).^2+(x(1:end-k)-x(1+k:end)).^2));end%****************************************************for i=1:Kmax   if(L(:,i)~=0 )    x2(:,i)=log(i);    y2(:,i)=log(L(:,i));   end end   l=length(x2)p2=polyfit(x2(1:30),y2(1:30),1);BestFit2=polyval(p2,x2);D_T=1-p2(:,1);for i=1:lLm_T=Lm_T+L(:,i);endLm_T=Lm_T/l;save Lm_T Lm_T;save DF_T D_T;plot(x2,y2,'b.','LineWidth',1)hold onplot(x2(1:l), BestFit2(1:l),'r-','Linewidth',2)xlabel('Jauge, log N', 'FontSize',10)ylabel('Longueur mesur閑, log N(s)' , 'FontSize',10)title(['Longueur Moyenne= ',num2str(Lm_T,'%10.4f'),' Dimension fractale= ',num2str(D_T,'%10.4f')]);h = legend('sujet normal',-1);set(h,'Interpreter','none');hold offsaveas(gcf,'Courbe_T.fig');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -