| 6 | 1/1 | 返回列表 |
| 查看: 1636 | 回復: 5 | ||||
kobybry_cn銅蟲 (初入文壇)
|
[求助]
這個程序求多重分形維數(shù)對嗎 已有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 ] |
資源收集 | 科研輔助-咔咔小男人 |

銅蟲 (初入文壇)
|
木蟲 (知名作家)
銅蟲 (初入文壇)

| 6 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 275求調(diào)劑 +3 | shansx 2026-03-22 | 4/200 |
|
|---|---|---|---|---|
|
[考研] 285求調(diào)劑 +5 | ytter 2026-03-22 | 5/250 |
|
|
[考研] 354求調(diào)劑 +7 | Tyoumou 2026-03-18 | 10/500 |
|
|
[考研] 08工科 320總分 求調(diào)劑 +7 | 梨花珞晚風 2026-03-17 | 7/350 |
|
|
[考研] 考研調(diào)劑 +3 | 呼呼?~+123456 2026-03-21 | 3/150 |
|
|
[考研] 326求調(diào)劑 +5 | 諾貝爾化學獎覬?/a> 2026-03-15 | 8/400 |
|
|
[考研] 材料與化工(0856)304求 B區(qū) 調(diào)劑 +3 | 邱gl 2026-03-21 | 3/150 |
|
|
[考研] 301求調(diào)劑 +10 | yy要上岸呀 2026-03-17 | 10/500 |
|
|
[考研] 初始318分求調(diào)劑(有工作經(jīng)驗) +3 | 1911236844 2026-03-17 | 3/150 |
|
|
[考研] 化學求調(diào)劑 +4 | 臨澤境llllll 2026-03-17 | 5/250 |
|
|
[考研] 307求調(diào)劑 +10 | 冷笙123 2026-03-17 | 10/500 |
|
|
[考研] 085700資源與環(huán)境308求調(diào)劑 +12 | 墨墨漠 2026-03-18 | 13/650 |
|
|
[考研] 一志愿南京理工大學085701資源與環(huán)境302分求調(diào)劑 +4 | 葵梓衛(wèi)隊 2026-03-18 | 6/300 |
|
|
[考研] 一志愿武理材料工程348求調(diào)劑 +3 |  ̄^ ̄゜汗 2026-03-19 | 4/200 |
|
|
[考研] 0703化學調(diào)劑 +5 | pupcoco 2026-03-17 | 8/400 |
|
|
[考研] 0854可跨調(diào)劑,一作一項核心論文五項專利,省、國級證書40+數(shù)一英一287 +8 | 小李0854 2026-03-16 | 8/400 |
|
|
[考研] 312求調(diào)劑 +8 | 陌宸希 2026-03-16 | 9/450 |
|
|
[論文投稿] 有沒有大佬發(fā)小論文能帶我個二作 +3 | 增銳漏人 2026-03-17 | 4/200 |
|
|
[考研] 考研調(diào)劑 +3 | 淇ya_~ 2026-03-17 | 5/250 |
|
|
[考研] 070303 總分349求調(diào)劑 +3 | LJY9966 2026-03-15 | 5/250 |
|