|
發(fā)布時(shí)間: 2023-4-5 17:17
正文摘要:求教大佬 這個(gè)w-m分形函數(shù)怎么用matlab打出來(lái) γ取1.5 Ds取2.5 |
function genWM(Ds,lambda,nmax) %GENWM 生成W-M 隨機(jī)曲面 % 此處顯示詳細(xì)說(shuō)明 % lambda % Ds 分形維數(shù) if nargin < 3 nmax = 10; if nargin < 2 lambda = 1.5; if nargin < 1 Ds = 2.3; end end end % nmax = 10; An = 2*pi*rand(nmax,1); Bn = 2*pi*rand(nmax,1); Cn = randn(nmax,1); x = 0:0.1:6; y = 0:0.1:6; [X,Y] = meshgrid(x,y); % lambda = 1.5; % Ds = 2.05; Z= zeros(length(x),length(y)); for ni = 1:nmax t = -(3-Ds)*ni; temp1 = X.*cos(Bn(ni)) + Y.*sin(Bn(ni)); zn = Cn(ni)*lambda^t.*sin(lambda^ni.*temp1+An(ni)); Z = zn + Z; end surf(X,Y,Z); xlabel('X'); ylabel('Y'); zlabel('Z'); filename = ['W-M fractal surface','_Ds',num2str(Ds),'_lambda',num2str(lambda),'.bmp']; saveas(gcf,filename,'bmp'); end |
可以的喲 |
頂 |
幫頂 |
可以寫的,按照固定格式來(lái) |
我還頂 |
頂 |
我再頂 |
再頂 |