VBÓëMatlab»ìºÏ±à³Ì
VBÓëMatlab»ìºÏ±à³ÌÓжàÖÖ·½Ê½£¬ÕâÀïÌÖÂÛMatlab½«MÎļþ±àÒë³Écom×é¼þ¹²VBµ÷Óõķ½Ê½¡£
Matlab°æ±¾£ºMatlab 7.7. 0.471 R2008b
VB°æ±¾£ºVB 6.0 & VB 2008
Ê×ÏÈдºÃÍê³Éij¸ö¹¦ÄܵÄmÎļþ£¬±ÈÈçÔÚmÎļþÖÐдÈëÈçϺ¯Êý
function [returns,stderr]=GetReturns(prices)
returns=price2ret(prices) %Çó¼Û¸ñÐòÁеĶÔÊýÊÕÒæÂÊ
stderr=std(returns) %ÇóÊÕÒæÂʵıê×¼²î
end
¸Ãº¯Êý½ÓÊÜÒ»¸ö¼Û¸ñÐòÁУ¬·µ»Ø¸Ã¼Û¸ñÐòÁеÄÊÕÒæÂʺÍÊÕÒæÂʵıê×¼²î¡£½«¸Ãº¯Êý´æ´¢ÎªGetReturns.m¡£
È»ºóÔÚmatlabÖÐÔËÐÐdeploytool´ò¿ª·¢²¼¹¤¾ß£¬Ö´Ðв˵¥File/New Deployment Project²Ëµ¥´ò¿ªÐ½¨ÏîÄ¿¶Ô»°¿ò£¬ÔÚ×ó²àÁбíÑ¡ÔñMATLAB Builder NE£¬ÔÚÓÒ²àÁбíÑ¡ÔñGeneric COM Component£¬È»ºóÔÚÏ·½NameÊäÈë¿òÊäÈëÏîÄ¿Ãû³Æ£¬µãOK°´Å¥È·¶¨½¨Á¢ÏîÄ¿¡£
Ö´ÐÐProject/Add File²Ëµ¥£¬Ñ¡Ôñ¸ÕдºÃµÄGetReturns.mÎļþ¡£Èç¹ûÏëÈÃCOM×é¼þ°üº¬¶à¸öº¯Êý£¬¿ÉÌí¼Ó¶à¸ömÎļþ¡£
½ÓÏÂÀ´¾ÍÊDZàÒëºÍ´ò°üÁË¡£Ö´ÐÐTools/Build²Ëµ¥£¬½«ÔÚ¹¤³ÌĿ¼µÄdistribÎļþ¼ÐϱàÒëÉú³Édll£¬×¢²á¸Ãdll(ʹÓÃregsvr32ÃüÁî)¼´¿ÉÔÚVBÖмÓÔز¢Ê¹ÓÃÁË¡£Æäʵ±àÒëÍê³Éºómatlab¾Í×Ô¶¯×¢²áÁ˹¤³ÌĿ¼µÄsrcÎļþ¼ÐϵÄdll£¬Ö±½ÓÔÚVBÖмÓÔØʹÓü´¿É¡£
Èç¹ûÒªÔÚûÓа²×°matlabµÄ»úÆ÷ÉÏʹÓøÃdll£¬¾ÍÒª½øÐдò°ü¡£Ö´ÐÐTools/Packge²Ëµ¥£¬matlab»á½«¸ÃdllÒÀÀµµÄcomponent´ò°ü³ÉÒ»¸öprojectName_pkg.exe£¬½«¸Ãexe¿½±´µ½Ä¿±ê»úÆ÷Ö´ÐУ¬»á½âѹ³öMCRInstaller.exe£¬MCRRegCOMComponent.exeºÍ_install.batÈý¸öÎļþ£¬Ö´ÐÐÅú´¦ÀíÎļþ_install.bat¼´»á°²×°Matlab Compiler Runtime£¨MCR£©£¬²¢ÇÒ×¢²áÎÒÃDZàÒëµÄdll¡£
VB2008ºÍVB6ÖÐʹÓÃdllµÄ×¢ÒâÊÂÏ
×¢²ádllºó¾Í¿ÉÔÚVBÖÐÏñʹÓÃÆäËûÒýÓÃ×é¼þÒ»ÑùʹÓÃÁË£¬Ö»ÊÇҪעÒâVB2008ºÍVB6ÖÐʹÓõIJ»Í¬Ö®´¦¡£VB2008Öе÷Óú¯ÊýµÄʱ£¬Êä³ö²ÎÊýÈç¹ûΪ¾ØÕó£¨Ò»Î¬»òÕ߶þά£©£¬¿ÉÒÔ¶¨ÒåÒ»¸ö¶þάÊý×é´«È뺯Êý¡£µ«ÔÚVB6Öв»ÄÜÕâôµ÷Óã¬Èç¹û¶¨ÒåÊý×é´«¸ømatlab±àÒëµÄdllÊǵò»µ½Êä³öÊý¾ÝµÄ£¬±ØÐ붨ÒåΪvariant±äÁ¿£¬×¢ÒâÊDZäÁ¿£¬²»ÊÇÊý×飬²ÅÄÜ»ñÈ¡matlabÒªÊä³öµÄ¾ØÕóÊý¾Ý¡£µ±È»£¬ÔÚVB2008ÖÐÒ²¿É½«²ÎÊý¶¨ÒåΪObjectÀàÐÍ£¬Í¬Ñù¿ÉÒÔÕý³£»ñÈ¡Êä³öÊý¾Ý¡£
»¹ÓÐÒ»µã£¬ÊäÈë²ÎÊý¾¡Á¿¶¨Òå³ÉdoubleÐÍÔÙ´«È룬·ñÔòdllÔËÐпÉÄܻᱨ´í¡£²âÊÔÖÐÓöµ½ÊäÈë²ÎÊýÖ±½Óд10ÔËÐб¨´í£¬¶øд³É10.0¾ÍûÎÊÌâ¡£
Ïà¹ØÎĵµ£º
ºÜ¶àÄêÇ°¾ÍÏë×öÒ»¸öÔ¶³Ì¿ØÖƵÄÈí¼þ£¬Ö»ÊÇÒ»Ö±ÒÔÀ´Í¼Æ¬µÄѹËõËÙ¶È×ÜÊÇÌáÉý²»ÉÏÈ¥£¬¶øÎÒÒ²²Î¿¼¹ýºÜ¶àÍøÉϵĹØÓÚͼƬѹËõµÄÀý×Ó£¬±ÈÈçzyl910µÄGIF_LZWѹËõ·½·¨£¬HuffmanѹËõ·½·¨£¬ÒÔÖÁµ½GDI+µÄÖ±½ÓÉú³ÉJPG¡¢PNGµÄ·½·¨£¨ÕâÖÖ·½·¨ÎÞÂÛ´ÓѹËõÂʺÍËÙ¶ÈÉ϶¼ÊÇ×î¼ÑµÄ£¬¿ÉϧÕâÖÖ·½·¨ÍøÉÏһֱûÕÒµ½Ö±½Ó±£´æΪByte()µÄÀý×Ó£¬¼ûµÃ×î¶àµÄ ......
×î¼òµ¥ÓÃVB°Ñasp·â×°³ÉdllµÄÈëÃųÌÐò
µ±IIS±»ÇëÇóÖ´ÐÐÒ»¸öASP³ÌÐò,ËüÊ×ÏÈ»áÔÚASPÎļþÖÐÕÒµ½<%%>±êÇ©Ö®¼äµÄ´úÂë,²¢ÇÒÖ´ÐÐËü(Ò²¿ÉÒÔÊÇ<scri ptrunat=server></script....>Ö®¼äµÄ´úÂë).Èç¹ûÕâ¸öASP³ÌÐòÔÚÏÈÇ°±»µ÷Óùý,ÄÇôËü¾Í»áÓÃÄÚ´æÖеıàÒë¹ýµÄ³ÌÐòÀ´ÏòÓû§·µ»ØHTML´úÂë,Èç¹ûûÓÐ,ÄÇôËü¾ÍÖØбàÒë.Õ ......
×î¼òµ¥µÄ·½·¨ÊÇʹÓÃfilesystemobject¶ÔÏ󡣶øËü²¢·ÇVBÄÚÖöÔÏó£¬
ÐèÒýÓòſÉÒÔʹÓá£
1£®filesystemObject¶ÔÏóÒýÓÃ
“¹¤³Ì/ÒýÓÃ/microsoft scription Runtime”
ÔÚ¶ÔÏóä¯ÀÀÆ÷´°¿ÚÖÐÑ¡“scripting”Ä£¿é£¬¿´µ½ÔöÁËÐí¶à¶ÔÏó£¬
drive filesystemobject textstream &nbs ......
Option Explicit
Function Delete3(Arr As Variant) As Variant
Dim i As Integer
For i = LBound(Arr) To UBound(Arr)
If i > UBound(Arr) Then Exit For
If Arr(i) = 3 Then
Do
Dim j As Integer
For j = i To UBound(Arr) - 1
......