| 查看: 1500 | 回复: 5 | ||||
kobybry_cn铜虫 (初入文坛)
|
[求助]
这个程序求多重分形维数对吗已有2人参与
|
|
clc; clear all; close all; %% %indata=inputdlg({'dla'}); a = imread('1.jpg');%%%%此处的1.jpg就是一条直线 [rows, cols] = size(a); figure;imshow(a); npix = sum(sum(a)); %% calculates niL which is the number of pixels in the ith box of size L % ideas from boxcount.m by F. Moisy have been borrowed here width = rows; p =log(width)/log(2); max_boxes = power(rows,2)/power(2,2); nL = double(zeros(max_boxes,p)); for g=(p-1):-1:0 siz = 2^(p-g); sizm1 = siz - 1; index = log2(siz); count = 0; for i=1:siz width-siz+1)for j=1:siz width-siz+1)count = count + 1; sums = sum(sum(a(i:i+sizm1,j:j+sizm1))); nL(count,index) = sums; end end end %% qran = 1; logl = zeros(p,1); for l=1:p logl(l) = log(power(2,l)); end %% normalized masses pL = double(zeros(max_boxes,p)); for l=1:p nboxes = power(rows,2)/power(power(2,l),2); norm = sum(nL(1:nboxes,l)); if(norm ~= npix) display('error'); end for i=1:nboxes pL(i,l) = nL(i,l)/norm; end end %% %falpha, alpha for l=1:p count = 0; nboxes = power(rows,2)/power(power(2,l),2); for q =-qran:+0.1:qran %denominator of muiql qsum = 0.0; for i=1:nboxes if(pL(i,l) ~= 0) qsum = qsum + power(pL(i,l),q); end end fqnum = 0.0; aqnum = 0.0; smuiqL = 0.0; for i=1:nboxes if(pL(i,l) ~= 0) muiqL = power(pL(i,l),q)/qsum; fqnum = fqnum + (muiqL * log(muiqL)); aqnum = aqnum + (muiqL * log(pL(i,l))); smuiqL = smuiqL + muiqL; end end if(uint8(smuiqL)~=1) display('error'); end count = count + 1; fql(l,count) = fqnum; aql(l,count) = aqnum; qval(count) = q; end end %% % alpha_q for i=1:count line = polyfit(logl,aql(:,i),1); aq(i) = line(1); yfit = polyval(line,logl); sse = sum(power(aql(:,i)-yfit,2)); sst = sum(power(aql(:,i)-mean(aql(:,i)),2)); ar2(i) = 1+(sse/sst); end % f_q for i=1:count line = polyfit(logl,fql(:,i),1); fq(i) = line(1); yfit = polyval(line,logl); sse = sum(power(fql(:,i)-yfit,2)); sst = sum(power(fql(:,i)-mean(fql(:,i)),2)); fr2(i) = 1+(sse/sst); end figure;plot(aq,fq,'r ');xlabel('\alpha(q)','FontSize',14); ylabel('f(q)','FontSize',14); [ Last edited by kobybry_cn on 2014-1-13 at 22:20 ] |
» 收录本帖的淘帖专辑推荐
资源收集 | 科研辅助-咔咔小男人 |
» 猜你喜欢
到新单位后,换了新的研究方向,没有团队,持续积累2区以上论文,能申请到面上吗
已经有6人回复
2025冷门绝学什么时候出结果
已经有7人回复
请问有评职称,把科研教学业绩算分排序的高校吗
已经有6人回复
Bioresource Technology期刊,第一次返修的时候被退回好几次了
已经有7人回复
真诚求助:手里的省社科项目结项要求主持人一篇中文核心,有什么渠道能发核心吗
已经有8人回复
寻求一种能扛住强氧化性腐蚀性的容器密封件
已经有5人回复
请问哪里可以有青B申请的本子可以借鉴一下。
已经有4人回复
请问下大家为什么这个铃木偶联几乎不反应呢
已经有5人回复
天津工业大学郑柳春团队欢迎化学化工、高分子化学或有机合成方向的博士生和硕士生加入
已经有4人回复
康复大学泰山学者周祺惠团队招收博士研究生
已经有6人回复

kobybry_cn
铜虫 (初入文坛)
![]() |
2楼2014-01-24 18:25:54
戴钢盔的猪头
木虫 (知名作家)
- 应助: 200 (高中生)
- 金币: 5083.9
- 散金: 1310
- 红花: 18
- 帖子: 6001
- 在线: 319.9小时
- 虫号: 2854040
- 注册: 2013-12-07
- 性别: GG
- 专业: 波谱分析与成像分析
3楼2014-01-24 18:59:31
kobybry_cn
铜虫 (初入文坛)
- 应助: 0 (幼儿园)
- 金币: 199.6
- 散金: 20
- 帖子: 22
- 在线: 6.1小时
- 虫号: 2215981
- 注册: 2012-12-31
- 性别: GG
- 专业: 控制论中的数学方法

4楼2014-01-25 23:00:59
5楼2014-03-10 09:44:43
6楼2015-11-09 12:33:21













width-siz+1)
');
回复此楼