Matlab °æ (¾«»ªÇø)
·¢ÐÅÈË: fork (Èö¹þÀɳĮµÄɳ), ÐÅÇø: Matlab
±ê Ìâ: ·ÖÎö£º½â¾öm³ÌÐòת»¯³Écpp³ÌÐòµÄ±àÒëÎÊÌ⡾С²¨¹¤¹¤¾
·¢ÐÅÕ¾: ¹þ¹¤´ó×϶¡Ïã (Sat Nov 29 21:32:06 2003), Õ¾ÄÚÐżþ
±³¾°£ºÓÐÒ»¸öÅóÓÑÏëÓÃС²¨±ä»»¶ÔͼÏñ´¦Àí£¬ÀûÓÃÏֳɵÄmatlabµÄС²¨¹¤¾ßÏäÖеÄ
³ÌÐò¡£µ«ÊÇËûµ¼Ê¦ÒªÇó½«ËùÓеÄmatlab³ÌÐòת»¯³ÉcÓïÑÔ³ÌÐò²¢ÔÚVC»·¾³Ï±àÒë¡£
Æäʵ£¬ÓÃmatlabµÄ³ÌÐòת»¯ÎªcppÎļþ²¢¶ÀÁ¢±àÒë´æÔÚןܴóµÄ¾ÖÏÞÐÔ¡£Ê×ÏȶÔÓÚ
ºÜ¶àÒѱàÒëºÃµÄmex³ÌÐò£¬ËäÈ»Äܹ»±àÒëͨ¹ýµ«Í¨³£»áµÃµ½Õâ¸ö¾¯¸æ£º
¡°the "XXX" function is only available in MEX mode. A run-time error
will occur if this code is executed in stand-alone mode.¡±Õâ»áÒýÆðÒ»¸ö
ÔËÐÐʱ´íÎó£¬×Ðϸ¼ì²é»á·¢ÏÖÕâÑùµÄmexÎļþÊÇÒÔdllÐÎʽ´æÔÚ£¬¶ÔÓ¦µÄmÎļþ
Ö»ÊÇÒ»¸ö»Ï×Ó¶øÒÑ£¬mÎļþµÄ´æÔÚ½ö½öÊÇΪÁËÌṩʹÓÃ˵Ã÷¶øÒÑ£»¼´Ê¹ÄãÓõ½µÄ
ËùÓк¯Êý¶¼ÊÇÒÔmÎļþ´æÔÚ£¬ÓÐʱºò»¹ÊÇÓÐÎÊÌ⣬Çë¿´ÏÂÃæµÄ³ÌÐò£º
£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥
function simon()
[X,map]=imread('simon.bmp');
x=X;
colormap(map);
x=double(x);
h=wavedecnd(x,2,'haar')
image(h{1});
£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥
¸Ã³ÌÐò¶Ôsimon.bmp×ö'haar'С²¨±ä»»²¢ÏÔʾµÚÒ»¿é¡£
±àÒëËü£ºmcc -B sglCpp simon
ÔËÐбàÒëºó×Ô¶¯Éú³ÉµÄsimon.exe£¬·¢Éú´íÎó£º
¡°Exception! File: handler.cpp, Line: 73
Variables are not supported by EVAL in compiled code.¡±
Õâ¶Î»°±íʾº¯Êý"eval"²»Ö§³Öcpp±àÒ룬µ«ÊÇÎÒÃDz¢Ã»ÓÐÏÔʽµÄµ÷ÓùýÕâ¸öº¯Êý
°¡£¬ÄÇô¿Ï¶¨ÊÇÔÚÎÒÃǵ÷ÓõÄÆäËûº¯ÊýÖмä½ÓµÄµ÷ÓÃÁËÕâ¸öº¯Êý¡£ÓÚÊÇ´ò¿ª
wavedecndº¯ÊýÒ»¸öÒ»¸öµÄ¼ì²éËùÓÐËüÖ±½Ó»ò¼ä½Óµ÷ÓùýµÄº¯Êý£¬×îºóÔÚ
wavemngr.mÖÐÕÒµ½Á˶ÔevalµÄÈý´Îµ÷Óãº
¡°eval(['load ' bin_file ' -mat'],'err = 1;');¡±
ÈçºÎÀ´½â¾öÕâ¸öÎÊÌâÄØ£¿mathworks¸ø³öÁ˴𰸣¬²Î¼û£º
http://www.mathworks.com/support/tech-notes/1100/1103.shtml
ÎÒÑ¡ÔñÁËÓá°try catch¡±½á¹¹Ìæ»»evalµÄ¼ä½Óµ÷Óãº
£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥
% eval(['load ' bin_file ' -mat'],'err = 1;');
try
load(bin_file,' -mat');
catch
err=1;
end
if err
err = 0;
% eval(['load ' bin_ini_file ' -mat'],'err = 1;');
try
load(bin_ini_file,' -mat');
catch
err=1;
end
.......................................
% eval(['save ' bin_file ' Wavelets_Info'],'err = 1;');
try
save(bin_file,' Wavelets_Info');
catch
err=1;
end
£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥
Íê³Éºó£¬ÔÙÒ»´Î±àÒ룺mcc -B sglCpp simon
ÔËÐгÌÐò£¬ÓÖ³ö´í£º
¡°Exception! File: handler.cpp, Line: 73
Reference to unknown function 'dbwavf' from FEVAL in stand-alone mode.¡±
Òâ˼ÊÇÔÚfevalÖе÷ÓÃÁËδ֪º¯Êý¡°dbwavf¡±£¬ÓÚÊÇÕÒµ½ÔÚwfilters.mÖÐÓÐÕâÑù
Ò»´¦µ÷Óãº
¡°F = feval(fname,wname);¡±
¶øfnameÀ´×ÔÓÚ¸ÃÎļþÖеÄÒ»¾ä£º
¡°[wtype,fname] = wavemngr('fields',wname,'type','file');¡±
×·²é£¡´ò¿ªwavemngr.m¿´µ½ÁËÕâÑùµÄÓï¾ä£º
¡°files = ...
{...
'dbwavf';
'dbwavf';
'symwavf';
'coifwavf';
'biorwavf';
'rbiowavf';
'meyer';
'dmey.mat';
'gauswavf';
'mexihat';
'morlet'
'cgauwavf';
'shanwavf';
'fbspwavf';
'cmorwavf'
};
¡±
ÓÚÊǽâ¾öµÄ·½·¨Ò²¾Í³öÀ´ÁË£¬·ÖÎö³ö´íµÄÔÒòÔÚÓÚÎļþÖÐÓÃfeval¼ä½ÓµÄµ÷ÓÃ
Á˺¯Êý¡°dbwavf¡±£¬fevalÖ»Êǽ«Ëü×÷×Ö·û´®¶ø²»ÊÇÎļþÃû´¦Àí¶ø֮ǰµÄ´úÂë
ÖÐÓÖûÓÐÏÔʽµÄÉùÃ÷¹ý¸Ãº¯Êý£¬Òò¶ø±àÒëÆ÷Ò²¾Í²»ÖªµÀ»¹ÐèÒªÔÚÉú³ÉµÄcpp´ú
ÂëÖмÓÉ϶Ըú¯ÊýµÄÉùÃ÷ÁË£¬Ò²²»»á¶îÍâµÄ½«dbwavf.mת»¯³ÉcppÎļþ£¬½â¾ö
µÄ°ì·¨ÓÐÁ½¸ö£º
1£¬Ö±½ÓÓá°F = dbwavf(wname)¡±À´Ìæ´ú¡°F = feval(fname,wname);¡±
ÔÙ±àÒ룬ÔËÐУ¬Ã»ÎÊÌâÁË:)
2£¬¶ÁÕßÒ»¶¨·¢ÏÖµÚÒ»¸ö°ì·¨ÖÐÎÊÌâÁË£¬Èç¹ûÊǵ÷ÓõÄsymwavf£¬»òÕßmorlet
»òÕßÈκαðµÄº¯ÊýÄØ£¿ÄÇôÕâ¸ö·½·¨¾Í½µµÍÔ³ÌÐòµÄÁé»îÐÔ£¬½â¾öµÄ·½·¨
£¨ºÇºÇ£¬Ïëµ½Õâ¸ö·½·¨ÊµÔÚÐèҪЩÁé¸Ð£¡£©¾ÍÊÇÔÚwfilters.mÖиõ÷ÓÃ
¡°F = feval(fname,wname);¡±Ö®Ç°¶ÔËùÓÐÓпÉÄÜÒªµ÷Óõ½µÄº¯Êý×öÒ»´Î
αÉùÃ÷£¨Ö®ËùÒÔ½ÐαÉùÃ÷ÊÇÒòΪmatlabÖÐËƺõûÓÐÉùÃ÷һ˵£¬¶øÕâô×öµÄ
ʵÖʵÈͬÓÚcÓïÑÔÖеÄÉùÃ÷£©£¬¼´ÔÚ¡°F = feval(fname,wname);¡±Ö®Ç°
¼ÓÉÏÒ»¾ä£º¡°dbwavf('haar');¡±
ÏÖÔÚ³ÉÁË£º
£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥
dbwavf('haar');
if wtype==1 % orth. wavelet
if ~isempty(mat_f)
F = eval(wname);
else
F = feval(fname,wname);
%F=dbwavf(wname);
end
..................................
£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥£¥
×¢Ò⣬ÎÒÖ»¼ÓÁËÒ»¾ä£º¡°dbwavf('haar');¡±£¬ÒòΪÎÒÖªµÀËüÖ»»áµ÷ÓÃ
ÕâÒ»¸öº¯Êý£¬Èç¹ûËüÒªµ÷Óöà¸öº¯Êý£¬Ö»ÒªÒÀÑù»ºù«¾ÍÐÐÁË¡£
±àÒ룬ÔËÐУ¬okÁË:)
ʣϵÄÊÂÇé¾ÍÊǽ«Éú³ÉµÄcppÎļþºÍhppÎļþ¼ÓÈëµ½VCÖеŤ³ÌÀÐÞ¸ÄÏàÓ¦
µÄ±àÒëºÍÁ¬½Ó²ÎÊý£¬±àÒë³öÒ»¸ö¶ÀÁ¢µÄexe³ÌÐòÁË¡£
--
¡ù À´Ô´:£®¹þ¹¤´ó×϶¡Ïã bbs.hit.edu.cn [FROM: 219.217.225.36]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
Ò³ÃæÖ´ÐÐʱ¼ä£º3.637ºÁÃë