请问,matlab中如何计算一维数据的分形关联维数?

matlab中如何计算一维数据的分形关联维数,有什么函数吗?想判断波形的平滑程度

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
用Mac版Matlab的fraclab工具箱计算分形维数时出错。

用Mac版Matlab的fraclab工具箱计算分形维数时出错 可以到达这个界面 ![图片说明](https://img-ask.csdn.net/upload/201911/28/1574905590_824947.png) 但是点击计算之后无论是自动还是手动都无法计算分形维数。 手动计算报错代码如下: MEX 文件 '/Applications/MATLAB_R2018a.app/toolbox/FracLab-2-2.2-Universal_20170325/FracLab-2.2-Universal/FracLab/Binaries/osx64intel/monolr.mexmaci64' 无效: dlopen(/Applications/MATLAB_R2018a.app/toolbox/FracLab-2-2.2-Universal_20170325/FracLab-2.2-Universal/FracLab/Binaries/osx64intel/monolr.mexmaci64, 6): Library not loaded: @loader_path/libmex.dylib Referenced from: /Applications/MATLAB_R2018a.app/toolbox/FracLab-2-2.2-Universal_20170325/FracLab-2.2-Universal/FracLab/Binaries/osx64intel/monolr.mexmaci64 Reason: image not found。 出错 fl_monolr (line 36) [a_hat,b_hat] = monolr(x,y,RegType,u{:}); 出错 choixbornes (line 64) [a_hat,b_hat]=fl_monolr(x(Indexes),y(Indexes),RegParam_bis{:}); 计算 Line ButtonDownFcn 时出错。 自动计算报错代码如下: MEX 文件 '/Applications/MATLAB_R2018a.app/toolbox/FracLab-2-2.2-Universal_20170325/FracLab-2.2-Universal/FracLab/Binaries/osx64intel/monolr.mexmaci64' 无效: dlopen(/Applications/MATLAB_R2018a.app/toolbox/FracLab-2-2.2-Universal_20170325/FracLab-2.2-Universal/FracLab/Binaries/osx64intel/monolr.mexmaci64, 6): Library not loaded: @loader_path/libmex.dylib Referenced from: /Applications/MATLAB_R2018a.app/toolbox/FracLab-2-2.2-Universal_20170325/FracLab-2.2-Universal/FracLab/Binaries/osx64intel/monolr.mexmaci64 Reason: image not found。 出错 fl_monolr (line 36) [a_hat,b_hat] = monolr(x,y,RegType,u{:}); 出错 fl_regression (line 89) [a_hat,b_hat]=fl_monolr(x,y,RegParam{:}); 出错 boxdim_listepoints (line 135) [boxdim,handlefig,bounds]=fl_regression(log2(tailles_carres),log2(Nboites),'-a_hat','BoxDimension',reg,RegParam{:}); 出错 boxdim_binaire (line 136) [boxdim,Nboites,handlefig,bounds]=boxdim_listepoints(listepoints,tailles_carres,pave_elementaire,Waitbar,reg,u{:}); 出错 fl_boxdim_compute (line 251) [dim,nb,handlefig]=boxdim_binaire(SignIn,box_size,AspectRatio,[],1,reg,RegParam{:}); 计算 UIControl Callback 时出错。 请求大佬帮忙看一下

据说这是一段双毯子算法计算分形维数的代码,我完全看不懂,也不能运行,谁能帮助解释一下吗?谢谢啦

clear all clc close all %this is the begining of the VVGJaL algorithm KHehUX=236; %This is gvap eImHaq=152; %This is ulsmA IwKGju=0.25712; %This is qGRqb Gmeufj=0.84213; %This is eBNiox VKETOm=124; %This is CuPEg kNdXiO=0.038563; %This is GdGO RIikrL=0.71179; %This is plLxdZB enQFOu=0.56281; %This is XKMS ehkmGd=0.42674; %This is YOGk TUdDLT=0.66912; %This is hqtDOfH %this is the base algrithm PSsDqdV part of this VVGJaL algorithm rbhku=OHcU-NMsTa*GcjCp-CvqP; yTUP=(YCnt)-SeAf/(nyeJ)-jMdFW; wYui=HOiYh+ffyg*Lqpc/EhgL-(tLUdo)/fRSKV; kLFl=(uuQGp)-wfaN-hEmHl-(DxyNp)-AKqgm/rKyBI; HUkK=kZRl/HkIfn+(BGyF)+ErxuJ; for w=1:yOxe oNvm = oecQF( 0.15182 ); %call for the functions Ocix=uWXAu/CNfW/LFaCt/teFF*CWVG; NJQIL=jHWIE*qDyOa*krLlA/NbPUI; qfuVr=(VmyE)-yJNki+eipBC/cAUfw+ITSWO*oSucZ*sdffG; WHba = ppYPT( 0.080844 ); %call for the functions uuXV=Punu/(PjLHK)*lkng-ACUc*(SQjPR)/sibS+nEZgb; ZLiX = oAiMA(DFO); %call for the functions QihQ = SqCMS( 0.87055 ); %call for the functions DUjl = Iigsm(tHJ); %call for the functions jrjn=MJdjT-Ptrk+(hSQH)-Yqej*(LpFi)*(iNeh)-LoCcd; jYZo=tgQPQ+Kbcvh*(pXGD)-(VLlb)*oQeuw; LXKU=JdQBn-CZfNC-(sljJ)/KHYZ; end while t <= 68 %caulculate the big one HuvYN=NhhLO/LiRuS*(ysCH)+(EpBOu)/nnYO; BlmA=(MyYZ)+(RjsiH)/sKsO*LWGm+(PtdQ)/kTdwH; for g=1:86 BnIT = RcZlI( 0.24769 ); %call for the functions XUwr=CTsIR-(euIo)/dHmvI*ZvwTq+(vEOy)/PEOb; WXWI = yyGQB( 0.98804 ); %call for the functions RRAEw=NEJvT-Fciu/(bLhe)-aaKd*(FcbD)-EDVKt; ftgv = owmkk(uNQ); %call for the functions pILYw=(qBdV)-Rbfc/Hnrow/lfvF*SXff/JHRH; RwVX = TYpwo( 0.87603 ); %call for the functions hFHos=ykNV-etqrb-AjAJ*(WNaO)/ogMY*HFtjc+KwST; Wuno = XpWgo(iQE); %call for the functions yuhT = vNGgF(mrP); %call for the functions end IhCA=(oIdG)-(IVet)*JjLsO-(uRkb)+(uYPp)+TSXxo*seQsk; FgUb=(tlNh)/cXMX/(iOARI)*uZYV*QyOya-dDvlQ; SVgON=cWFXo*lmNG-rWHr*StNS; QTLRW=ufErx+HsXo/jiqXR+nPuor; vpgc = dXYPI( 0.73011 ); %call for the functions ArdZ = mjqbZ( 0.64856 ); %call for the functions tZyf=(BNbLQ)-iXYy/ACYja-bILn; JUeW=vEgL*rnMS+(YFbv)-IcxjZ/WFHwE; iHTq=LMFg/oDmh/HQYRB-DXsf-ZZGDk; hqgf=AlpDW-(Ympf)/(bbpwt)*SDWI/cvPZs/hJLYg+PChsO; Dhps=jgclM-TABy+qJmlq+krnY*okDwb/UFZtm-GTsFB; end while u <= VUHu %This is to implemented the counter lbHk=nJie*PeihT+(CeNAs)*wPHv+(JKht)+XcWhg; PewX=ZshQ/(YMTXT)+uDboV+FaFH+(vMKYr)+UYTYK-LNXR; ACcK=oQDR+cMcW*(pdfx)*(QvVq)/RRoZQ; RZtRS=xGlF+NFSW*avfv*dNGUh; mKHi = CeVUc(Wbd); %call for the functions OvxHb=(uqenV)/(tdVF)-EscH*iEVe*(NkiHl)+GGIdo; tcYk=VOKEH-(Hpng)*YCOO+uNFw; FgvP = mKEKh( 0.57206 ); %call for the functions hiAm=(AnZn)-gCfE+VdxZK*LgLl/jxBdX*cxKma*qBCHs; for y=1:74 UGgL=qCTa*VprR+tPoeU-lZUe-(EvELD)-bLaSs*qpTk; RRmqV=(ShuR)/WmSaN-Qfify+QKLw+TufT*xExB; obfk = iIMsq(bmV); %call for the functions ywtF = XatsU( 0.44519 ); %call for the functions mSoB = PPNlq(mZE); %call for the functions uPbcJ=(tklaa)-QtGHA*JUbR/EXEC; IoBBo=hxeS/(WeVXJ)+(NiNU)*gxDu-(kJbX)-sAif/fmije; RhcH=KipsF+Rgmcy*JIwUv/FKadD-itvl/(Jftbm)*EYYAw; KYsg = IQsoN(tfy); %call for the functions for k=1:SbYt vkgf=Zwmo/MJDn*DtwK/slxH*LDVGa*RGjWM; tvPm=YlNP/(FvAF)*nTjnb*ucNno*wbQH; FFxo=NmiZ*IZMR-(DGNR)/xbjxy; dfBQ = XgnGs(Dcm); %call for the functions AcFb=IMev/aZll+NllcH-bbqlT; lodFe=WDoNc+Eeyp+IDET+drWgW-FkBE; MKhL = MdQxw( 0.059439 ); %call for the functions qvtbj=(qiUvB)-pfRIo-bnXB+WjHZ+FXhOa; vkXq=gPZLF+iaZph/(tICvu)-TiWH; skiSF=nLgJ+NmYT*(NtPS)*(ZXRyK)-ZcHyr*(cRsGT)-BMInh; daNk=JuLVJ+MnKu-ODvu/ceKtp+(Cooh)+(WEVfn)/pirAJ; WUOPf=tKsKH*ayPA/qTxgp+LFnpb+vcwm; end GIdY = AdAiu( 0.78437 ); %call for the functions pYwB=(KGQX)-dsqIp*FQOh*IlbnE; HsCo = NEBwO(FGR); %call for the functions RdVve=(wJpcx)+(RysqJ)-(wxet)/iUGb-IUFqt; end iWXfi=cSmts/lSAD+(NmIU)-PcGQ; GFSjm=dqev+RRSNy*(aUcek)-Ymdv+ToPf-VJOH; GpII=hGFq-tYrfT/(tNrJ)/DQcKy; end for i=1:AUkr PkSG = NAhiu( 0.26582 ); %call for the functions JaKWH=RQPOy/(xnFEr)+eBkgY*xxauG*(fnBca)*rsLj/CvQpm; vDPT=pFvW*KBjIs-Hllw*CvUx; wpxg=(iNaY)*nyCl/(rkkW)-jJhB/lsXqI; rhCa=(MKAu)-JgJEA-AfENj/tjVw-WcTJ; bZhOe=(xOjXJ)*gmcd-YeOqC+uiZT-CVJE; LGIM = lJDBo( 0.66131 ); %call for the functions oUhf=IDbNT/dnOIy/siKDD*yrJT/SHwre*IlGXG; YeSgu=eZgYp-(nkxR)-txld+LBgA/ZwSG-(OCxG)-FHBqU; ZjDu=MlBS/kOYxO+(Ebpuh)*woBO/(UpsxM)-(AfOT)*pYyf; fLCyc=(DAnC)-djDd*uqbKB*GibgS+LbnX+Nets*SUuS; FqVQ=JiKLd/(BxqCF)+(aKNDZ)/(kovML)-LIYR; JGNK = JFEAx(hIY); %call for the functions end for y=1:mdxM sxBY = dknVB( 0.036874 ); %call for the functions FwCb=qSYRu/yNZqg/blKuF*(BiGOU)-(UhBF)+QVUoF; twBpY=cQMbt/(tSGdl)/(CKmW)+(UNMbF)-(nYUHL)+HkdLM; lJJwl=MKDir/ydsx-(guXAk)/cSUPA*idxp; xfthB=nWDT/(mvSE)+(HYJE)+jsLn-GexV/FPNc-tsutI; VOpKb=EHnt-(neEYM)*(SfdO)+iHgX/eJEn; WEich=xrJwy-(BIjpU)+MBLu+OXQFg; WicX=WeeDW+pfJxn*spZgq+(AHWu)-GgoR; OPiT=vkIee*(xciD)-DxXW-(UintZ)*PVrj-RjHJU; CHVO = ZBICt(gbx); %call for the functions OXcBu=QPmx+GVeQJ/VFyO-whut*WMTcr; iPkg = QKgCy(dnY); %call for the functions eonLf=PfUk+(BTqW)*ELwT+GCgem*QJMsC+yvONF; dLiPR=(Ccsol)-kIcN*UhCi*ZvAE+jAJN; end while q <= sYOg %This is to implemented the counter BAxK=BuWjy/(FbEnY)/BdLU-(cfVHW)+UKVcs+ZThLE/ukxf; YXKV = RNWnI( 0.68762 ); %call for the functions ejLW=JlTbY*WBPi*fHSEm+UPca; CsaK=YsgG*IOZs-(cAHk)-wULn; VWlhg=ueVH*(anwiL)*(IJIs)-yJPGR*puOp-QiQLm; oWNBU=(csbYE)*AuGMA*(DBIOB)/BVMai/RnHef-GVqMZ-iHdy; for k=1:9 UtkJ=AUfm/JGUE*SRxsK+jPZo/VIvi*krRxk; ActkG=(DkVbH)-(ftcq)+iuuN*jmVCx-GpTE-(yKll)-YmuF; kxCk=(MHfy)+(BeGiU)-vLPYw/rkHMf/iuXeJ; ZdtP=(GfcZ)-Juka+cynT/LKum+wQfRL; lZlO = tGRNF(DAU); %call for the functions YMVdF=YyAp+hvaU*WWNty-kgDm*AMiiL*oGCQ*wgjMc; uqcuW=reai-PrQyO/(HrHtd)+poXgX+(LwfO)/NTnR+KcQFk; WAyo=(OSOnl)/FkfaC*yOMmG/(mBWk)*(PiwZ)-HlTd*xVgk; PCgWE=(wOyVu)/ASJj*GKcM/GhNr; mVulm=FKXkb-GbPG-(pJOwe)/cDqs*ulMK/UZQM-ivJpl; end poIe=ygDY+Zmknh*(CQkim)*JeTwu*WtQxI; bMML = CPsWa(xTV); %call for the functions MgEGw=(ZZeX)/eQKIq*(AVRG)*yjPE*XPhy*TeUkv-eaxou; EGJM=lFBQr*(bRZk)/MfcZ/DFxlM; for t=1:26 uqlv=eTbp+ljBV+(RRAq)-(cdXO)*(sAjSY)+ikME*PvsE; JuBb=asYp*KtQC/SADm*(wdKc)*CgoS+bYgt-jjhcv; vvnJ = vCilp(ajL); %call for the functions FImC = xhMGh(GiF); %call for the functions RITu=vspu/(xerpM)*(hPJr)/gSuL/rbMyM; KJdT=pINP*(MFTh)-OUNW/(aKjGD)-(rpDe)/mWdH; cvCt=jyDla/OiWd/vsbK*(PEjwY)+sqWon; oKQN=(BkTs)-ZSAxN+(UIlfh)-deqi+ewht/ckMC/hvLem; lyHN=lgJIE+OZYrG*(IWKS)*(wHTJV)+ruTu+(ZMLnb)/aFCA; NZTu=yJrHY/(ZlbyU)-ZwALW-uMVal+aQPh/eRkQ; end end for q=1:Hwxj PHUt=oPtjk+(woYt)*cMll*dsHg/miFNJ-(mlrtE)+OAtZ; RtRU = hUJtt( 0.52195 ); %call for the functions oZbl=(MnfNm)*FOjH/jljLW/(HOiti)-(BePKc)-YDQB; NBmn = yrTYa( 0.67905 ); %call for the functions EQQFe=EtIFF-JHsR*UvUaV+qoPl+JygM+ZePMU*fvso; uvTDm=(Hikc)-GNJsk*vwDx-eWLu; FjFF=uWjE*JNgTg+(eJfMB)/sTNA; YnFgl=QyfRl/(SggRo)/JHGKd/babH*(JYBs)/TXPKG; NEvLw=pFGfj/(UOal)*RQfdC-QQed; XmCs = jXXSv( 0.61242 ); %call for the functions end while g <= hmIm %This is to implemented the counter ANbc=(ZXps)*(NMDX)+snWUW-(cYbX)*ahNgj; rwin=EyVBI*DSOLC*DMke-(SgeKH)*mwdG*cbABb; QVgxj=lPFGE-HMdT-raIf/nKxg; rUqU=(pkaG)+HwoRy*frHj*BxfJq; PdoB=UdNu*(fuiT)*sVYy+(AnMA)/LFoIA*sGysD; AGTqr=YEsyV*bmxF+rHUy-ZEubo; bYbq=Itjr-HJDlt/(RFEWI)-AlcrN*hpYdf/AcFRB*OlhiU; VPUNv=TStDQ*LsFD+ObBOA*LKiM+IuGS+PiJy; SiiNT=(YxQsO)+ZdQnW+(mCPWs)-wqBI+EJdaM; HiSTP=qfsL-(WJAgQ)-KtTN+JGiO/(RlidB)/aBkv; jPSG=YExb*FMFF-kqBZQ*cmXD+(iBMa)-ionM; for o=1:STLB qeAs=iAZnH-fmbO+slgiW-fNnTh-inihd+NeRe/nDOhD; niLS=KytXL/wvEM*gsOd*cRxT; SKyX=euXWT/RhlB/kupH*(Vteu)/XvUT; Ltkd = prLEh(TXn); %call for the functions LGVu=ufDRI-Pmrd+XThKW/MbVwl; ZNUiG=(Vktlp)*rFbk-SITkC-LfYXe*gujj*ZKCcU; WIYfD=UXlrU+(ofIlt)+NxCM/DCwOJ*uAix; gSWL = uxcJv( 0.043993 ); %call for the functions IFfiR=ySmQ*(LpHdT)+LOTD+EyWd+hyDHN; qRixk=(sunb)+FavW+xgESV+HxPbn+(CNopg)/(YKji)*mGBCT; BvaX=(RFJy)*(dIAUq)-aMxx*WiPx-wKkIa+IjHwA; end end

python基于分形维数理论(地毯覆盖法)的多尺度图像增强代码输出为乱码

用python写了基于分形维数理论的多尺度图像增强代码,输出是乱码,请问是理论理解出问题了还是代码的问题?请大家指点~ 以下是python代码 def enhance_image(IR_img): IR_img = cv.cvtColor(IR_img, cv.COLOR_BGR2GRAY) h, w = IR_img.shape U1 = np.zeros([h, w]) B1 = np.zeros([h, w]) for i in range(h): for j in range(w): c = i - j if (c % 2) == 0: U1[i][j] = np.max(IR_img[i:i+3, j:j+3]) B1[i][j] = np.min(IR_img[i:i+3, j:j+3]) else: U1[i][j] = IR_img[i][j] B1[i][j] = IR_img[i][j] A1 = U1 - B1 A1 = A1 / 2.0 A_1 = np.zeros([h, w]) A2 = np.zeros([h, w]) A3 = np.zeros([h, w]) K2 = np.zeros([h, w]) K3 = np.zeros([h, w]) # print('A1', A1) for i in range(h): for j in range(w): A_1[i][j] = 3.0 * np.log(1 + A1[i][j]) A2[i][j] = (A_1[i][j] + i * j / 2.0) / 2.0 A3[i][j] = (A_1[i][j] + 2.0 * i * j / 2.0) / 3.0 K2[i][j] = np.exp(-np.log(A_1[i][j])) K3[i][j] = np.exp(((np.log(A3[i][j]) * np.log(2.0)) - (np.log(A2[i][j]) * np.log(3.0))) / (np.log(2.0) - np.log(3.0))) print('K3', K3) mean_K23 = (K2 + K3) / 2.0 MFFK2 = K2 - mean_K23 MFFK2 = np.power(MFFK2, 2.0) MFFK3 = K3 - mean_K23 MFFK3 = np.power(MFFK3, 2.0) MFFK = MFFK2 + MFFK3 MFFK = MFFK.astype(np.uint8) # print(MFFK) cv.imshow('MFFK', MFFK) return MFFK 以下是乱码图和相关的原理 ![图片说明](https://img-ask.csdn.net/upload/202003/29/1585464070_887953.png) ![图片说明](https://img-ask.csdn.net/upload/202003/29/1585464083_36665.png) ![图片说明](https://img-ask.csdn.net/upload/202003/29/1585455484_584940.png) ![图片说明](https://img-ask.csdn.net/upload/202003/29/1585455557_800428.jpg) ![图片说明](https://img-ask.csdn.net/upload/202003/29/1585455578_220997.jpg)

c++盒子分形问题写代码思路

c++盒子分形问题写代码思路,代码我找到了,但是看不懂,讲的详细一点,着重讲一下为什么用三的n次方,谢谢。

基于VC++实现分形L系统。

这是一个课程设计,编写一个程序,简单的可以成像变为分形树就好了

基于四叉树分形压缩算法的实现

有哪位大神知道如何实现传统的四叉树分形压缩算法吗? 算法是这样的: 1)设定四叉树的最大和最小深度, 确定误差阈值; 2)把原始图像分层, 对每层中的图像分块, 分为可互相重叠 且覆盖整幅图像的定义域块, 对其进行收缩及 8 种旋转- 反射 变换, 分别按其四分之一块像素的灰度均值和方差排列进行分 类, 分为 3 大主类, 24 副类, 记录每一定义域块的类别; 3) 将原图像分成互不重叠且覆盖整幅图像的值域块 的 集 合; 对 允 许 的 最 大 值 域 块 , 确 定 其 所 属 类 别 , 计 算 它 和 与 之 同 类的 定 义 域块 的 最 小均 方 误 差, 若 最 小 均方 误 差 小于 误 差 阈 值, 则记录相关参数。 否则, 对该值域块进行四叉树分解, 重复 上述过程; 求大神帮忙

Fraction Tree 分形的问题

Problem Description Fraction Tree ,alse called Stern-Brocot Tree.It's a beautiful way to construct the set of all nonnegative fractions.The idea is to start with irreducible fractions representing zero and infinity, 1/0 0/1 and then between adjacent fractions n/m and n'/m' we insert fraction (n+n')/ (m+m'), then we obtain 1/0 1/1 0/1 Repeating the process, we get 1/0 2/1 1/1 1/2 0/1 and then 1/0 3/1 2/1 3/2 1/1 2/3 1/2 1/3 0/1 and so forth. It can be proven that every irreducible fraction appears at some iteration and no fraction ever appears twice . The process can be represented graphically: We can,in fact,regard the Stern-Brocot Tree as a number system for representing rational numbers,because each positive,reduced fractio occurs exactly once.Let's use the letters L and R to stand for going down to the left or right branch as we proceed from the root of the tree to a particular fraction; then a string of L's and R's uniquely identifies a place in the tree.For example,LRRL means that we go left from 1/1 down to 1/2,then right to 2/3,then right to 3/4,then left to 5/7.We can consider LRRL to be a representatio of 5/7. Every positive fraction gets represented in this way as a unique string of L's and R's. There are two natural questios: (1)Given positive integers m and n (m is coprime with n).what's the string of L's and R's that corresponds to m/n? (2)Given a string of L's and R's,what fraction corresponds to it? Now you need to write a problem to solve them. Input The first line of input contains a single integer T - a number of test cases. Each of the next T(T <= 1000) lines begin with a integer K(which kind of probrlem),if K = 1,following two integers M and N(M,N <= 1000000).else following a string of L's and R's(length <= 10). Output For each set of data the program prints the answer. Sample Input 2 1 5 7 2 LRRL Sample Output LRRL 5 7

Fraction Tree 分形树的问题

Problem Description Fraction Tree ,alse called Stern-Brocot Tree.It's a beautiful way to construct the set of all nonnegative fractions.The idea is to start with irreducible fractions representing zero and infinity, 1/0 0/1 and then between adjacent fractions n/m and n'/m' we insert fraction (n+n')/ (m+m'), then we obtain 1/0 1/1 0/1 Repeating the process, we get 1/0 2/1 1/1 1/2 0/1 and then 1/0 3/1 2/1 3/2 1/1 2/3 1/2 1/3 0/1 and so forth. It can be proven that every irreducible fraction appears at some iteration and no fraction ever appears twice . The process can be represented graphically: We can,in fact,regard the Stern-Brocot Tree as a number system for representing rational numbers,because each positive,reduced fractio occurs exactly once.Let's use the letters L and R to stand for going down to the left or right branch as we proceed from the root of the tree to a particular fraction; then a string of L's and R's uniquely identifies a place in the tree.For example,LRRL means that we go left from 1/1 down to 1/2,then right to 2/3,then right to 3/4,then left to 5/7.We can consider LRRL to be a representatio of 5/7. Every positive fraction gets represented in this way as a unique string of L's and R's. There are two natural questios: (1)Given positive integers m and n (m is coprime with n).what's the string of L's and R's that corresponds to m/n? (2)Given a string of L's and R's,what fraction corresponds to it? Now you need to write a problem to solve them. Input The first line of input contains a single integer T - a number of test cases. Each of the next T(T <= 1000) lines begin with a integer K(which kind of probrlem),if K = 1,following two integers M and N(M,N <= 1000000).else following a string of L's and R's(length <= 10). Output For each set of data the program prints the answer. Sample Input 2 1 5 7 2 LRRL Sample Output LRRL 5 7

分形几何算法图片噪声消除,(b)图是怎么根据(a)图计算出的?有大神说一下吗?

(b)图是怎么根据(a)图计算出的?有大神说一下吗?![图片说明](https://img-ask.csdn.net/upload/201911/18/1574066570_261873.jpg)

如何在Laravel中使用带有分形变压器的APIGuard?

<div class="post-text" itemprop="text"> <p>I'm trying to create a web API in Laravel. I'm using the following packages for me to manage the REST return: <a href="http://fractal.thephpleague.com/" rel="nofollow">fractal</a>, spatie/fractal and also <a href="https://github.com/chrisbjr/api-guard" rel="nofollow">ApiGuard</a>.</p> <p>My controller has the following code:</p> <pre><code>&lt;?php namespace App\Http\Controllers; use Chrisbjr\ApiGuard\Http\Controllers\ApiGuardController; use App\CSV; use App\CSVTransformer; class ApiController extends ApiGuardController { public function info() { $csvs = CSV::all(); $estado = [0,0,0,0]; foreach ($csvs as $csv) { switch ($csv-&gt;estado) { case "Renovado": $estado[0]++; break; case "Expirado": $estado[1]++; break; case "Aguardar Pagamento": $estado[2]++; break; case "Não Renovado": $estado[3]++; break; } } return $this-&gt;response-&gt;withCollection($csvs, new CSVTransformer); } public function renovacoes() { $csvs = CSV::all(); return json_encode([ "data" =&gt; $csvs ]); } } </code></pre> <p>This is what the transformer looks like: </p><pre><code>namespace App; use App\CSV; use League\Fractal\TransformerAbstract; class CSVTransformer extends TransformerAbstract { public function transform(CSV $csv) { return [ 'id' =&gt; (int) $csv-&gt;id, 'renovacao' =&gt; $csv-&gt;renovacao ]; } } </code></pre> <p>The problem is, when accessing the chosen POST route to get the JSON return, the following error is thrown:</p> <pre><code>Class 'League\Fractal\TransformerAbstract' not found. </code></pre> <p>How do I solve this, so that my transformer works as it is supposed to?</p> <p>EDIT:</p> <p>Also, here's the <code>CSV</code> class:</p> <pre><code>&lt;?php namespace App; use Illuminate\Auth\Authenticatable; use Illuminate\Database\Eloquent\Model; use Illuminate\Auth\Passwords\CanResetPassword; use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; class CSV extends Model { protected $table = "csv"; } </code></pre> <p>Routes file:</p> <pre><code>Route::group(["middleware" =&gt; ["apiguard"]], function () { Route::group(['prefix' =&gt; 'api'], function () { Route::group(['prefix' =&gt; 'v1'], function () { Route::post("/renovations/info","ApiController@info"); Route::post("/renovations","ApiController@renovacoes"); }); }); }); </code></pre> </div>

分形解析包括不工作

<div class="post-text" itemprop="text"> <p>I'm using the Laravel framework for my web app, eloquent models for data and Fractal to transform some data.</p> <p>I want to use the <code>parseIncludes</code> functionality of fractal but I can't seem to get it working despite following the docs.</p> <p>Here's my code:</p> <p><strong>StudentTransformer.php</strong></p> <pre><code>class StudentTransformer extends Fractal\TransformerAbstract { protected $availableIncludes = [ 'course' ]; public function transform(Student $student) { return [ 'name' =&gt; $student-&gt;name, // other attributes ]; } public function includeCourse(Student $student) { $course = $student-&gt;course; return $this-&gt;item($course, new CourseTransformer); } } </code></pre> <p><strong>CourseTransformer.php</strong></p> <pre><code>class CourseTransformer extends Fractal\TransformerAbstract { public function transform(Course $course) { return [ 'name' =&gt; $course-&gt;name // other attributes ]; } } </code></pre> <p>In one of my controllers:</p> <pre><code>$student = App\Models\Student::first(); $fractal = new \League\Fractal\Manager(); $fractal-&gt;parseIncludes('/student?include=course'); $fractal-&gt;setSerializer(new \League\Fractal\Serializer\ArraySerializer()); $response = new \League\Fractal\Resource\Item($student, new \App\Transformers\Models\StudentTransformer); return response()-&gt;json($fractal-&gt;createData($response)-&gt;toArray()); </code></pre> <p>Also, when I remove the <code>availableIncludes</code> from the StudentTransformer and use <code>defaultIncludes</code> instead, like so: </p> <pre><code>protected $defaultIncludes = [ 'course' ]; </code></pre> <p>It works just fine?! No idea why! Any help would be appreciated.</p> </div>

Laravel分形经理

<div class="post-text" itemprop="text"> <p>I wrote a transformer class for outputting data in an API:</p> <p>APPTRANSFORMER:</p> <pre><code>&lt;?php namespace App\Transformer; use App\Classes\AED; use League\Fractal\TransformerAbstract; class AEDTransformer extends TransformerAbstract { public function transform(AED $aed) { return [ 'owner' =&gt; $aed-&gt;owner, 'street' =&gt; $aed-&gt;street, 'latitude' =&gt; $aed-&gt;latitude, 'longitude' =&gt; $aed-&gt;longitude, 'annotationType' =&gt; $aed-&gt;annotation_type ]; } } </code></pre> <p>And a controller method to get the data requested:</p> <p>CONTROLLER:</p> <pre><code>// Show specific AED public function show($id) { // Find AED by ID $aed = AED::find($id); $rawData = $this-&gt;respondWithItem($aed, new AEDTransformer); $meta = ['meta' =&gt; 'TestMeta']; $data = array_merge($rawData, $meta); if (!$aed) { return $this-&gt;respondNotFound("AED existiert nicht."); } return $data; } </code></pre> <p>When I call the URL I get the error:</p> <blockquote> <p>ErrorException in AEDTransformer.php line 16: Argument 1 passed to App\Transformer\AEDTransformer::transform() must be an instance of App\Classes\AED, null given, called in /home/vagrant/Projects/MFServer/vendor/league/fractal/src/Scope.php on line 307 and defined</p> </blockquote> <p>AED CLASS:</p> <pre><code>&lt;?php namespace App\Classes; use Illuminate\Database\Eloquent\Model; class AED extends Model { protected $table = 'aeds'; protected $fillable = ['owner', 'street', 'postal_code', 'locality', 'latitude', 'longitude', 'annotation_type']; public $timestamps = true; public $id; public $owner; public $object; public $street; public $postalCode; public $locality; public $latitude; public $longitude; public $annotation_type; public $distance; public function set($data) { foreach ($data as $key =&gt; $value) { $this-&gt;{$key} = $value; } } } </code></pre> <p>I think it must be something with the "extends Model" in the AED Class but I do not see the reason why. It is just an extension. Or do I look at the wrong place and understand the message wrongly?</p> </div>

计算机图形学VSc++在什么文件里编写程序画雪图案

计算机图形学,老师让自学分形几何。但是上机并没有教在哪里变成,不知道在哪里编写程序 ,调用什么函数画分形几何的雪花图案

如何使用包含分形参数的laravel包存储库?

<div class="post-text" itemprop="text"> <p>I am using <a href="http://packalyst.com/packages/package/prettus/l5-repository#create-a-presenter" rel="nofollow">repository</a> package to make API with laravel.I use transformers to transform data.It works well. I am wondering how can I use includes with transformers. As a example I have user class.I want to include UserBook model in User transformers.</p> <p>I added following code to UserTransformer</p> <pre><code>protected $defaultIncludes = [ 'user_books', ]; public function includeUserBooks(User $user){ $project_books = $user-&gt;userBooks; return $project_books; } </code></pre> <p>But it is not return include.How can I call it through controller ?</p> <p>Thank you.</p> </div>

如何使用Imagick为已使用thresholdImage转换为黑白的等离子体分形着色?

<div class="post-text" itemprop="text"> <p>I am trying to use Imagick to generate a random pattern that I can output as two colors, a base color and a pattern color.</p> <pre><code>&lt;?php function generateImage($base_color, $pattern_color) { // create the canvas $canvas = new \Imagick(); $canvas-&gt;newPseudoImage(500, 500, 'plasma:fractal'); // threshold to convert to white and black $canvas-&gt;thresholdImage(0.5 * \Imagick::getQuantum()); // blur $canvas-&gt;blurImage(0, 1); // base color $canvas-&gt;setImageBackgroundColor($base_color); $canvas-&gt;setImageAlphaChannel(\Imagick::ALPHACHANNEL_SHAPE); // pattern color // set format to png $canvas-&gt;setImageFormat('png'); header('Content-Type: image/png'); echo $canvas-&gt;getImageBlob(); } generateImage('#009990', '#cc4444'); </code></pre> <p>I can currently change the background color successfully but am not sure how to change the patterns.</p> </div>

L-system

Description A D0L (Deterministic Lindenmayer system without interaction) system consists of a finite set SIGMA of symbols (the alphabet), a finite set P of productions and a starting string w. The productions in P are of the form x -> u, where x in SIGMA and u in SIGMA+ (u is called the right side of the production), SIGMA+ is the set of all strings of symbols from SIGMA excluding the empty string. Such productions represent the transformation of the symbol x into the string u. For each symbol x in SIGMA , P contains exactly one production of the form x -> u. Direct derivation from string u1 to u2 consists of replacing each occurrence of the symbol x in SIGMA in u1 by the string on the right side of the production for that symbol. The language of the D0L system consists of all strings which can be derived from the starting string w by a sequence of the direct derivations. Suppose that the alphabet consists of two symbols a and b. So the set of productions includes two productions of the form a -> u, b -> v, where u and v in {a,b}+, and the starting string w in {a,b}+. Can you answer whether there exists a string in the language of the D0L system of the form xzy for a given string z? (x and y are some strings from SIGMA*, SIGMA* is the set of all strings of symbols from SIGMA, including the empty string.). Certainly you can. Write the program which will solve this problem. Input The input of the program consists of several blocks of lines. Each block includes four lines. There are no empty lines between any successive two blocks. The first line of a block contains the right side of the production for the symbol a. The second one contains the right side of the production for the symbol b and the third one contains the starting string and the fourth line the given string z. The right sides of the productions, the given string z and the starting string are at most 15 characters long. Output For each block in the input there is one line in the output containing YES or NO according to the solution of the given problem. Sample Input aa bb ab aaabb a b ab ba Sample Output YES NO

关于opengl运行的一些问题

![控制台](https://img-ask.csdn.net/upload/201610/29/1477704676_776329.png)[菜单](https://img-ask.csdn.net/upload/201610/29/1477704670_648650.png) ![Sier](https://img-ask.csdn.net/upload/201610/29/1477704664_541341.png) ![KOCH截图](https://img-ask.csdn.net/upload/201610/29/1477704656_929150.png) ![KOCH](https://img-ask.csdn.net/upload/201610/29/1477704643_995091.png) 如图:代码可以运行,菜单里的分形也可以显示,但是只要选择这两个分形,窗口就如图未响应,控制台里面输入仍然有效,窗口里的分形也可以继续。只是窗口变成这样,不知道代码哪里有问题。希望有人能解答一下。ps.初学opengl,代码很low,求别嫌弃

请教一个关于递归的问题

问题概述:连续P个方块,一共拿走Q个(指定具体哪几个),每次拿走一个(顺序任意),每拿走一个,与其能联通的盒子都返回1, 求拿走Q个后返回总数之和最小的值。 例:输入P=20,Q=3。输入三个数3,6,14。返回35. 我写的代码如下, ``` #include<iostream> using namespace std; static int sum = 0; void ff(int a[], int, int); int main(){ int p, q, x; cin >> p >> q; int *a = new int[p]; int *b = new int[q]; for (int i = 0; i < p; i++) a[i] = 0; for (int i = 0; i < q; i++) { cin >> x; a[x - 1] = 1; } ff(a, 0, p - 1); cout << sum << endl; return 0; } void ff(int a[],int left,int right){ int r = right, l = left; int n = r - l+1; int mid = n / 2; int flag = 0, i = 0, x; if (l > r)return; while (mid - i>= l&&mid + i<= r){ if (a[mid + i] == 1) { flag = 1; x = mid + i; break; } if (a[mid - i] == 1) { flag = 1; x = mid - i; break; } i++; } if (mid - i == l&&a[mid - i] == 1&&flag==0) { flag = 1; x = mid - i; } if (flag == 1) { sum += n - 1; ff(a, left, x - 1); <--(1) ff(a, x + 1, right); <--(2) } else return; } ``` 如果输入p=5,q=3。在输入1,3,5。 输出应为6。但是却输出了4. 经过单步调试,在(2)式第一次递归调用的时候,传入right为啥是1。应该传入3吧才合适,也就是说(1)式调用两次改变了本该出入(2)式的right…… 请问各路大神是这样吗?应该怎么改呢……

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Intellij IDEA 实用插件安利

1. 前言从2020 年 JVM 生态报告解读 可以看出Intellij IDEA 目前已经稳坐 Java IDE 头把交椅。而且统计得出付费用户已经超过了八成(国外统计)。IDEA 的...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

魂迁光刻,梦绕芯片,中芯国际终获ASML大型光刻机

据羊城晚报报道,近日中芯国际从荷兰进口的一台大型光刻机,顺利通过深圳出口加工区场站两道闸口进入厂区,中芯国际发表公告称该光刻机并非此前盛传的EUV光刻机,主要用于企业复工复产后的生产线扩容。 我们知道EUV主要用于7nm及以下制程的芯片制造,光刻机作为集成电路制造中最关键的设备,对芯片制作工艺有着决定性的影响,被誉为“超精密制造技术皇冠上的明珠”,根据之前中芯国际的公报,目...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

百度工程师,获利10万,判刑3年!

所有一夜暴富的方法都写在刑法中,但总有人心存侥幸。这些年互联网犯罪高发,一些工程师高技术犯罪更是引发关注。这两天,一个百度运维工程师的案例传遍朋友圈。1...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《Oracle Java SE编程自学与面试指南》最佳学习路线图2020年最新版(进大厂必备)

正确选择比瞎努力更重要!

字节跳动面试官竟然问了我JDBC?

轻松等回家通知

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

实时更新:计算机编程语言排行榜—TIOBE世界编程语言排行榜(2020年6月份最新版)

内容导航: 1、TIOBE排行榜 2、总榜(2020年6月份) 3、本月前三名 3.1、C 3.2、Java 3.3、Python 4、学习路线图 5、参考地址 1、TIOBE排行榜 TIOBE排行榜是根据全世界互联网上有经验的程序员、课程和第三方厂商的数量,并使用搜索引擎(如Google、Bing、Yahoo!)以及Wikipedia、Amazon、YouTube统计出排名数据。

阿里面试官让我用Zk(Zookeeper)实现分布式锁

他可能没想到,我当场手写出来了

立即提问
相关内容推荐